Link to home
Start Free TrialLog in
Avatar of sl1nger
sl1nger

asked on

select statement that adds values

I need to a select statement that will pull the qty together for the same cust_id

what I have...
log_id           qty        cust_id
1047      1          36134
1048      1          36134
1049              4          3332

result...
cust_id     qty
36134       2
3332         4
ASKER CERTIFIED SOLUTION
Avatar of Swindle
Swindle
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SELECT
     SUM(QTY) TOTALQTY,
     CUST_ID
FROM
     <table_name>
GROUP BY
     CUST_ID