SQL query for finding the most frequent value of a grouped by value
<p>I'm using SQLite browser, I'm trying to find a query that can find the max of each grouped by a value from another column from:</p>

<p>Table is called main</p>

<pre><code>|  |Place  |Value|
| 1| London|  101|
| 2| London|  20|
| 3| London|  101|
| 4| London|  20|
| 5| London|  20|
| 6| London|  20|
| 7| London|  20|
| 8| London|  20|
| 9| France|  30|
| 10| France|  30|
| 11| France|  30|
| 12| France|  30|
</code></pre>

<p>The result I'm looking for is the finding the most frequent value grouping by place:</p>

<pre><code>|  |Place  |Most Frequent Value|
| 1| London|   20|
| 2| France|   30|
</code></pre>

<p>Or even better</p>

<pre><code>|  |Place  |Most Frequent Value|Largest Percentage|2nd Largest Percentage|
| 1| London|   20|   0.75|   0.25|
| 2| France|   30|   1|   0.75|
</code></pre>