Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两张桌子。TableA 有两列,TableB 有一列。
身份证 | TERM_A
TERM_B
TERM_A 和 TERM_B 列包含术语。我想从 TableA 的 TERM_A 列和 TableB 的 TERM_B 列与 Oracle 10 上的 sql 相交。我的结果表应该是这样的:
身份证 | INTERSECT_TERMS
我怎样才能做到这一点?
INTERSECT 运算符返回一个包含来自两个查询的匹配值的结果集。
select * from tableA where term_a in ( select term_a from tableA intersect select term_b from tableB ) ;
因为要从 TABLEA 中选择其他列,所以需要将交集的输出用作子查询。