Stupid MySQL question

Stupid MySQL question

Post by Daniel Kap » Fri, 04 Apr 2008 14:51:38


Sorry, it's late but am trying to do a count on a table that gives me sum of
search based on user id. In other words

Select sum from Records by userid order by sum.

So that that the results I get back are

userid: 103 7 records
userid: 106 7 records
userid: 105 6 records
userid: 104 5 records
userid: 102 3 records
userid: 101 1 records


I have to tell you, that I'm not stupid, although I have my moments. But am
just really tired and can't figure out the right statement. Any help would
be so appreciated.

Thanks ahead as always.
 
 
 

Stupid MySQL question

Post by Erick T. B » Fri, 04 Apr 2008 19:26:31

Daniel Kaplan:

GROUP by userid, I suppose

--
Erick