[snip]
Is it possible to do two left joins involving three
tables in one query?

select a.id, a.amount FROM t1
LEFT JOIN t2 ON (t1.id=t2.id)

then

LEFT JOIN t3 ON (t1.id=t3.id)

Is this even possible?
[/snip]

Yes, and the keys from table to table don't have to be the same, save
for each JOIN..

SELECT a.id, a.amount, b.invoiceID
FROM t1 a LEFT JOIN t2 b
ON(a.id = b.id)
LEFT JOIN t3 c
ON(b.invoiceID = c.invoiceID) <---look Ma, different relation!)
WHERE c.invoiceID IS NULL (c is empty for this query)



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to