67,512
社区成员
发帖
与我相关
我的任务
分享
select * from table1 t1
left join table2 t2
on t1.name=t2.name
select name, (select distinct b.sex2 from table2 b where b.name2 = a.name) as sex2 from table1 a where name in(select name2 from table2)
select t1.name,t1.sex from table1 t1 where t1.name in(select t2.name2 from table2 t2) and t1.sex in (select t3.sex from table2 t3)