>Hi All,
>
>I have a JOIN statement:
>
>SELECT d.*, b.invoice_id FROM domain_info d LEFT JOIN billing_info b ON
>d.domain_id=b.domain_id
>WHERE billing_cycle = '12' OR billing_cycle = 'Z' OR billing_cycle = 'C'
>GROUP BY domain_name
>
>In addition to the fields this statement returns, I would also like it
>to include the result of
>this second statement:
>
>SELECT sum(ammount_due) FROM billing_info WHERE domain_id = $domain_id
>AND status = 0


>How can I augment my SELECT statement to also return this additional
>sum(ammount_due) field for
>each domain (row)?

Sir, add the SELECT clause field list and WHERE conditions of the 
second statement to the SELECT and WHERE clauses of the first 
statement.

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to