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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More SQL 1

Status
Not open for further replies.

ivalum21

MIS
Jul 14, 2004
63
US
Okay...I have a list of customer orders with their totals. They are grouped by the items that were bought, so if you bought a car, that is one record, and if you also bought a truck, that is another record with the same order number. How do i group those two records to display the total amount of the one order?
 
Code:
select customer
     , sum(itemamount) as orderamount
  from yourtable
group
    by customer

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top