[同崗但有點複雜問題]LEFT JOIN幫助MySQL的
它應該是簡單的,但我缺少something.I有2個表
table_one(toneid是自動增量與主鍵)
toneid id email
1 634 45
2 643 23
3 648 55
table_two(TID被自動增量與主鍵)
tid
633
634
643
648
我想要的結果應該是
tid email
633 null
634 45
643 23
648 55
我的查詢是
select table_two.tid,
table_one.id,
table_one.email
from table_two
left join table_one on table_one.id = table_two.tid
但它返回
tid email
634 45
643 23
648 55
或者可以反向加入,即'from table_two left join table_one on table_one.id = table_two.tid' –
謝謝阿比克。現在解決了。 – user3671491