I am trying to have information displayed for this query:
SELECT o.sub_number,o.unique_id,o.period_from,o.period_to,o.total_amt,
i.paid_amt,i.dated,i.payment,i.paid_by,i.entered_date,i.paid_for_unique,
j.cheque_num,j.drawn_on,j.dated AS cheque_dated
FROM paid_details o, payment_details i,cheque j
WHERE o.unique_id=i.unique_id
AND o.unique_id=j.unique_id
AND o.sub_number IN (
SELECT sub_number
FROM paid_details
WHERE unique_id LIKE '%1271437707%'
);
it flops. Well the problem is sometimes the cheque might not have any information in it. So how do i get MYSQL to ignore that table and still continue displaying the rest of the information?
thanks!
Update
I tried:
SELECT t1.sub_number,t2.dated,t3.cheque_num
FROM paid_details AS t1
INNER JOIN payment_details AS t2
ON t1.unique_id=t2.unique_id
INNER JOIN cheque AS t3
ON t1.unique_id=t2.unique_id
WHERE t1.unique_id IN (
SELECT unique_id
FROM paid_details
WHERE sub_number='6526'
);
but it results in the empty set. If I remove the details on CHEQUE, then it gives me results.