select * from maindata where ([NO] in (select [NO] from Index_AB where [AB] = 'liver')) and ([NO] in (select [NO] from Index_AB where [AB] = 'cancer'))
select * from maindata where ([NO] in (select [NO] from Index_AB where [AB] = 'liver')) and ([NO] in (select [NO] from Index_AB where [AB] = 'cancer')) 表Index_AB NO,AB 1,liver 1,cancer 1,as 1,bs 2,liver 2,cacer 3,vkb 想检中NO相同的包含liver 也包含cancer的字段 当词比较
select
a.*
from (maindata as a
inner join (select [NO] from Index_AB where [AB] = 'liver') as b on a.[NO]=b.[NO])
inner join (select [NO] from Index_AB where [AB] = 'cancer') as c on a.[NO]=c.[NO]