I have a sequel statement that I would like it to list the customer # in the results and have tried to add to the SELECT line. When I add to the SELECT line, I receive the ORA-00937 error. Could someone please advise as how I get the customer # to list in the results. I tried to add the GROUP BY command, but that did not bring the information back either.
Thanks - Deb
1 select sum(decode(a.dc_cd, 'C',nvl(amt,0)*(-1), 'D',nvl(amt,0), nvl(amt,0))
2 from ar_trn_tp a, ar_trn b
3 where a.trn_tp_cd = b.trn_tp_cd
4 and b.stat_cd = 'P'
5 and b.origin_store = '08'
6 and b.post_dt < '&age_date'
7 and b.cust_cd = '&cust_cd'
8* group by b.cust_cd
Enter value for age_date: 25-apr-11
old 6: and b.post_dt < '&age_date'
new 6: and b.post_dt < '25-apr-11'
Enter value for cust_cd: 00133667
old 7: and b.cust_cd = '&cust_cd'
new 7: and b.cust_cd = '00133667'