I have a table consisting of customer purchase records having following columns
CUSTOMER TRANSDATE SALENUM STORE TRANSTYP PRICE
-------- --------- --------- ----- --------- ------
1 12-FEB-2013 777 O CASH 7.99
1 12-FEB-2013 777 O CASH 6.99
1 12-FEB-2013 778 O CARD 9.17
2 23-APR-2013 987 D CASH 7.65
1 15-MAY-2013 1098 T CARD 2.35
I want to aggregate over salenum i,e for each salenum, i want the total price, as well as the store, transtyp, transdate,customer values as these are same for a particular salenum
However if i use
select customer,transdate,salenum,store,transtyp,sum(price) from table1 group by salenum
Its obviously saying not a valid group by value. How to get the desired result?
SAMPLE RESULT:
CUSTOMER TRANSDATE SALENUM STORE TRANSTYP PRICE
-------- --------- --------- ----- --------- ------
1 12-FEB-2013 777 O CASH 15.98
1 12-FEB-2013 778 O CARD 9.17