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 06-29-2006, 03:35 PM
premgrps@gmail.com
 
Posts: n/a
Default Calculate Cumulative

Hi,
I have a database where I have to find the summation of points for
each person. The example below has the name repeating multiple times. I
am new to mysql. Would you please let me know what query would be good
for getting what I want? The sample is below.

Thanks:

Name | Points
Jack 10
Mack 20
Jack 25
Jack 25
Mack 30
John 5
Jack 10
John 10
John 5
Jill 10
John 30
Jill 10

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-29-2006, 03:58 PM
Paul Lautman
 
Posts: n/a
Default Re: Calculate Cumulative

premgrps@gmail.com wrote:
> Hi,
> I have a database where I have to find the summation of points for
> each person. The example below has the name repeating multiple times.
> I am new to mysql. Would you please let me know what query would be
> good for getting what I want? The sample is below.
>
> Thanks:
>
> Name | Points
> Jack 10
> Mack 20
> Jack 25
> Jack 25
> Mack 30
> John 5
> Jack 10
> John 10
> John 5
> Jill 10
> John 30
> Jill 10


SELECT name, sum(points) from mytable group by name


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 08:29 PM.




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