Premium problem41. Mode From Compressed Counts

Medium Locked

value_counts(value, frequency)

Return the most frequent value or values. Where several share the maximum frequency, return all of them, sorted ascending.

Return a single column value. Returning only one row when there is a tie is the common mistake, which ORDER BY frequency DESC LIMIT 1 would make.

Tables

value_counts

value  frequency
-----  ---------
1.00   5
2.00   9
3.00   9
4.00   2

Expected result

value
-----
2.00
3.00

Premium problem

This one's part of Premium. Unlock the full MySQL track plus every other premium problem on the site.

Write one SELECT query