我想扩展这个简单的子选择:
Select * from table1 where pkid in (select fkid from table2 where clause...)
上面的逻辑相当简单 - 获取 table1 中 pkid 包含在从具有 where 子句的子选择查询返回的子集中的所有行。它运作良好,因为只有 1 个字段被返回。
现在我想对此进行扩展。
在表 1 中我想返回结果 where field1 and field2 and field3 in select (field1, field2, field3 from table2 where 子句...)
这怎么可能?
提前致谢。
例子。
表格1
FIELD1 FIELD2 FIELD3
1 2 3
2 3 4
4 5 6
表 2
2 3 4
4 5 6
我想返回 2 个结果。