22,209
社区成员
发帖
与我相关
我的任务
分享
select id from table2 where id in(select distinct id
from table1
where name='ZHANG'
)
select b.id
from table1 a,table2 b
where a.id=b.id
and a.id='ZHANG'
select *
from table2
left join (select distinct id
from table1
where name='ZHANG'
) A on A.id = table2.id
where 1=1
select * from
(select distinct id
from table1
where name='ZHANG' ) a join table2 as b
on a.id=b.id