I know this forum is for
Java but I'm a java developer that has to figure this SQL out and I have done Joins until I'm blue to no avail.
With the following table, key and relationship information:
Client: nClientId, cClientName where nClientId is the PK.
Terms: nTermsId, cTermsDesc where nTermsId is the PK.
Bills: nBillId, nClientID, nTermsId, nAmount where nBillId is the PK and nClientId
is an FK to the Client Table.
Payments: nBillId, dDate, nPaid where nBillId is an FK into bills.
For every client there exists none, one or many bills.
For every bill there exists none, one, or many payments.
For every bill there exists one term.
We are interested in seeing the following columns for all clients. For each client, we
wish to see all bills - paid or not:
cClientName, nBillId, cTermsDesc, dDate & nPaid
Anyone? I would appreciate it dearly!