Sherif - 9:42 pm on Aug 11, 2010 (gmt 0)
If we do this, then how will the left join work if the invoice_id is removed from the ON clause when the relation between both tables use the unique id for each row depending on 3 columns (building_no, apartment_no, invoice_id) if we only use the building_no, and apartment_no then there will be hundreds of matches, but the payments will not know which invoices it should be depending on.
How will each payment be associated to the invoice that it depends on? Especially that we can have more than one payment for the same invoice, or even have a payment without an invoice.
Thanks for your support.