left join一对多只保留一条结果的解决方法

select * from
(select user_id from tabel_1)a
left join
(select user_id from tabel_2 group by user_id) b
on a.user_id = b.user_id

你可能感兴趣的:(mysql,mysql,left,join,一对多)