August 15, 2009 at 12:37 pm
Hi everyone I need help with sql select statement.I have table and in that table some columns have same value like:
John 23
Smith 36
Suzan 21
John 12
and I don't know how to write select statement that would add columns with same name and select the other columns too.The result should be
John 35
Smith 36
Suzan 21
Please help.
Thanks in advance
August 15, 2009 at 12:50 pm
SELECT yourtable.name, Sum(yourtable.amount) As total
FROM yourtable
GROUP BY yourtable.name
hope this helps
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
August 15, 2009 at 2:24 pm
Thanks for your reply I solved my problem.
Thanks!!
August 15, 2009 at 2:34 pm
you're welcome
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply