Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql query 1

Status
Not open for further replies.

ishikha

Programmer
Mar 22, 2002
36
0
0
IN
hi friends,

how i can write the sql query for this

my table "document" is like this

name description total
a abc 5
b df 2
c jb 4
a dfg 12

now i want that it gives me the ans

name total
a 17

that means it shows the total of particular name along with name


regards
ishikha
 
hi,

i want the output as:

name total
a 17
b 2
c 4


ishikha
 
Hi, this is fairly easy. Try running this query:

Code:
SELECT Name, Sum(total) AS My_Total FROM MyTable GROUP BY Name;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top