HAVING SUM (t2.netdue) = MAX(t1.balance)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bill Downall
Sent: Thursday, September 20, 2001 6:14 AM
To: [EMAIL PROTECTED]
Subject: Re: What's wrong with this syntax?
Try it the other way around, with the aggregate function left of the equal
sign in the Having clause. Also, be specific that you are grouping by the
same patnumbr that you are SELECTING:
... GROUP BY t1.patnumbr +
HAVING SUM (t2.netdue) = t1.balance
Bill
On Wed, 19 Sep 2001 21:15:41 +0000, MJS wrote:
>SELECT T1.patnumbr FROM patinfo T1, baldue T2 WHERE
T1.patnumbr =
>T2.patnumbr GROUP BY patnumbr HAVING T1.balance = SUM
(T2.netdue)