我有两张桌子。
tbl_Invoice
tbl_Payment
我想要的是List of Pending/Partial Invoices
一个特定的客户。
我尝试过的是:
Select * from tbl_Invoice I
left join tbl_payment P on (I.client_id = P.client_id
AND I.invoice_id <> P.invoice_Id)
left join tbl_client C on I.client_id = C.client_id
WHERE I.client_id = 8
但它给了我一些错误的输出。
Invoice No Client Name Date details Amount Paid
----------------------------------------------------------------
ATPL00001 Vishal 10 Dec,2012 Web Designing 100.00 50.00
ATPL00001 Vishal 10 Dec,2012 Web Designing 100.00 10.00
ATPL00001 Vishal 10 Dec,2012 Web Designing 100.00 100.00
ATPL00001 Vishal 10 Dec,2012 Web Designing 100.00 100.00
ATPL00002 Vishal 07 Dec,2012 Software Development 1000.00
所以我不知道如何获得待处理/部分支付的发票。
谁能帮忙啊!!