Subject | SQL help needed please. |
---|---|
Author | tickerboo2002 |
Post date | 2006-11-27T11:10:29Z |
Suppose I have the following tables:
Clients
Client_ID
Address1
Address2
etc
Invoices_Outstanding
InvoicesOutstanding_ID
Client_ID
Amount
Invoices_paid
InvoicesPaid_ID
Client_ID
Amount
Date_Paid
With one SQL query, is it possible to retrieve a row from Clients
(PK=CLIENT_ID) and also a count of the number of entries in both
Invoices_Outstanding and Invoices_Paid? Something like:
Client_ID,
Address1,
Address2,
CountOfInvoicesOutstanding,
CountOfInvoicesPaid.
Thanks.
Clients
Client_ID
Address1
Address2
etc
Invoices_Outstanding
InvoicesOutstanding_ID
Client_ID
Amount
Invoices_paid
InvoicesPaid_ID
Client_ID
Amount
Date_Paid
With one SQL query, is it possible to retrieve a row from Clients
(PK=CLIENT_ID) and also a count of the number of entries in both
Invoices_Outstanding and Invoices_Paid? Something like:
Client_ID,
Address1,
Address2,
CountOfInvoicesOutstanding,
CountOfInvoicesPaid.
Thanks.