Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-2008, 05:51 AM
Daniel Kaplan
 
Posts: n/a
Default Stupid MySQL question

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-03-2008, 10:26 AM
Erick T. Barkhuis
 
Posts: n/a
Default Re: Stupid MySQL question

Daniel Kaplan:
> 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.


GROUP by userid, I suppose

--
Erick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:50 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.