i have to select sum of amount in the table cflows which is only group by certain number of deal_no, but i have to select other things as well, the code i've written is:
SELECT deals.deal_no,cparty.code, anacode.name, cparty.deal_ext, mmdeals.bor_invest, Sum(cflows.amount)
FROM anacode, cparty, deals, mmdeals, cflows
WHERE cflows.comments='PRINCIPAL' AND deals.deal_no = mmdeals.deal_no AND deals.deal_no = cflows.deal_no AND deals.cparty = cparty.thekey AND cparty.analyse01 = anacode.thekey
GROUP BY cflows.deal_no, deals.deal_no,cparty.code, anacode.name, cparty.deal_ext, mmdeals.bor_invest
this code doesn't work, is there another way of doing this?thanks for any help!
SELECT deals.deal_no,cparty.code, anacode.name, cparty.deal_ext, mmdeals.bor_invest, Sum(cflows.amount)
FROM anacode, cparty, deals, mmdeals, cflows
WHERE cflows.comments='PRINCIPAL' AND deals.deal_no = mmdeals.deal_no AND deals.deal_no = cflows.deal_no AND deals.cparty = cparty.thekey AND cparty.analyse01 = anacode.thekey
GROUP BY cflows.deal_no, deals.deal_no,cparty.code, anacode.name, cparty.deal_ext, mmdeals.bor_invest
this code doesn't work, is there another way of doing this?thanks for any help!