34,593
社区成员
发帖
与我相关
我的任务
分享
select *
from (select 1 id,'a' col ) a
left join (select 1 id,'b' col union all select 1,'c') b on a.id=b.id
/*
id col id col
1 a 1 b
1 a 1 c
*/
select ta.* from ta left join tb on ta.colname=tb.colname
--用这条查查,查出来的就是在T2表中对应有超过1条记录的
select t1.* from t1,t2 where t1.id=t2.id having count(1)>1