Sample table:id values
1 1
2 2
3 1
4 3
5 1
6 2Task: write an SQL query to select the most commonly repeated value from the table above
1 1
2 2
3 1
4 3
5 1
6 2Task: write an SQL query to select the most commonly repeated value from the table above
from tablename
group by values
limit 1;[align=center]==== 思想重于技巧 ====
[/align]
from tablename
group by values
order by 2 desc
limit 1;[align=center]==== 思想重于技巧 ====
[/align]