Shaun Callender [EMAIL PROTECTED] wrote:
I'm using mySQL 4.0 trying to solve what I think is a simple problem.
to calculate the balance by account #
can this be done without the use of temporary tables ?
TABLE 1 contains
ACCOUNT #, INVOICE #, INV TOTAL
TABLE 2 contains
there can be
Hi all,
-Original Message-
From: Victoria Reznichenko [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 3:18 PM
To: [EMAIL PROTECTED]
Subject: Re: incorrect SUM() results
Shaun Callender [EMAIL PROTECTED] wrote:
I'm using mySQL 4.0 trying to solve what I think is a simple
Shaun Callender [EMAIL PROTECTED] wrote:
calculate the balance by account #
TABLE 1 contains
ACCOUNT #, INVOICE #, INV TOTAL
TABLE 2 contains
there can be multiple payment records associated with an invoice
ACCOUNT #, INVOICE #, PAYMENT, PAYMENT DATE
select TABLE1.accountno,
You're running a join on table two which will result in the following set (if
you remove the group by and sum()s):
ABCCORP 500, 150, 350 (from table 1, row 1, join table 2, row 1)
ABCCORP 500, 50, 300 (from table 1, row 1, join table 2, row 2)
ABCCORP 500, 50, 250 (from table 1, row 1, join