I have 2 tables, money_sheet and cash_receiving. The linking column is document_num. The cash_receiving table has one amount per document_num. the money_sheet table has multiple amounts per document_num. The cash_receiving table is the money as it comes into the agency. The money_sheet table is how that money is spent. I need to get a sum of the money_sheet.amount per money_sheet.document_num to see if the sum of the money_sheet.amount = the cash_receiving.amount.
select m.document_num, m.amount, c.amount
from money_sheet m, cash_receiving c
where m.document_num = c.document_num
group by m.document_num, m.amount, c.amount
I tried making the m.amount, sum(m.amount) but that just sums each entry for m.amount, not the sum of all the m.amounts for the m.document_num.
Any suggestions are greatly appreciated!!
select m.document_num, m.amount, c.amount
from money_sheet m, cash_receiving c
where m.document_num = c.document_num
group by m.document_num, m.amount, c.amount
I tried making the m.amount, sum(m.amount) but that just sums each entry for m.amount, not the sum of all the m.amounts for the m.document_num.
Any suggestions are greatly appreciated!!