mysql - List all rows despite join -
mysql - List all rows despite join -
i don't understand why trying doesn't work.
i have 2 tables
table1 id_tb1 | tb1field 1 aaa 2 bbb 3 ccc 4 ddd 5 eee table2 id_stuff | id_tb1 1 1 1 4 1 5 2 1 3 1
what id need bring together tb1 , tb2 list records tb1. :
result id_tb1 | tb1field | tb2.id_stuff 1 aaa 1 2 bbb null 3 ccc null 4 ddd 1 5 eee 1
so did :
select t1.*, t2.id_stuff table1 t1 left bring together table2 t2 on t2.id_tb1 = t1.id_tb1 t2.id_stuff = 1
but obviously, it's not solution. has an thought ? thx.
if add together status on left joined table in clause, if doing inner join.
add status left join
select t1.*, t2.id_stuff table1 t1 left bring together table2 t2 on t2.id_tb1 = t1.id_tb1 , t2.id_stuff = 1
mysql sql
Comments
Post a Comment