SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) LEFT JOIN t3 ON t2.b = t3.b OR t2.b IS NULL