有二张表,表1中满足条件的行中某列值,在表2中找到对应的满足条件的行列1
如:select 列3,列4 from {表1} where [列1] = 'a' and [列2] = 'b'
dim ss as string = dt.datarows(i)("列4")
查找表1结果中所有行中列4的值满足在表2中 select * from {表2} where [列1] = ‘“& ss &"' and [列2] = 'c'
然后找出在表2中找到结果的所有表1的数据行。
不知如何描述,不知是否说清楚没?请教各位帮尽忙,谢谢!!
select a.*
from {表1} a
join {表2} b on a.[列4 ]= b.[列1]
where a. [列1] = 'a' and a.[列2] = 'b' and b.[列2] = 'c'