select a.col1,a.col2,b.col1 from a,b where a.col3=b.col3 and a.col1=(select col1 from c)

所有的表及字段都正确合法
2025-03-30 21:14:05
推荐回答(1个)
回答1:

如果你C表有多行数据就不行吧。要么限定只返回一行

select a.col1,a.col2,b.col1 from a,b where a.col3=b.col3 and a.col1=(select top 1 col1 from c)

要么就改用in吧

select a.col1,a.col2,b.col1 from a,b where a.col3=b.col3 and a.col1 in (select col1 from c)