select * from table1 a, table2 b left join table3 c on b.id = c.id where a.id = b.id