View Single Post

   
  #1 (permalink)  
Old 05-07-2008, 10:17 AM
Kynn Jones
 
Posts: n/a
Default GROUP BY, ORDER & LIMIT ?

Suppose table X has two columns: class (TEXT) and size (INT). I want a
listing showing the (up to) 5 largest values of "size" for each value of
"class" (for some values of "class" the total number of available records
may be less than 5).

What would be the simplest way to achieve such a listing? It seems like
something one could do with GROUP BY, ORDER, and LIMIT, but I can't figure
out the right syntax for this query.

Thanks!

Kynn

Reply With Quote