View Single Post
  #1 (permalink)  
Old 07-07-2008, 05:02 PM
Unregistered
 
Posts: n/a
Default ANY dialect question:

select the most commonly repeated value from the table


write an SQL query to select the most commonly repeated value from the table below.

id values
1 1
2 2
3 1
4 3
5 1
6 2

I try this, but not work. Please help. thnaks
select a.* from test a,(

select value,count(value) as num from test

group by value)b where a.value=b.value

order by b.num desc
Reply With Quote

ANSWER(S):