---- MySQL LEFT JOIN, RIGHT JOIN AND Union ALL issues.!
Sherif - 9:05 pm on Aug 10, 2010 (gmt 0)
Thanks a lot for your cooperation, but i have a problem using this method.
When i tried using this method, in the payments table, there are more than one column that i need to retrieve since it contains relevant data to the payment itself, example payment_method, payment_location, payment_description etc...
SELECT invoices.*,(SELECT payment_value, payment_method, payment_location, payment_description FROM payments WHERE invoices.building_no = payments.building_no AND invoices.apartment_no = payments.apartment_no AND invoices.invoice_id = payments.invoice_id) AS payment_column
WHERE building_no = 1 AND apartment_no = 1
When i modified the query to obtain these columns, I got the MySQL Error #1241 - Operand Should Contain 1 Column(s) What should i do if i need to obtain more than one column from the other table in the subquery?