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.
私は2つのテーブルを持っています。TableAには2つの列があり、TableBには1つの列があります。
ID | TERM_A
TERM_B
TERM_AおよびTERM_B列には用語が含まれています。Oracle 10のSQLを使用して、TableAのTERM_A列とTableBのTERM_B列から交差項を取得したいと思います。結果テーブルは次のようになります。
ID | INTERSECT_TERMS
どうやってやるの?
INTERSECT 演算子は、2 つのクエリから一致する値を含む結果セットを返します。
select * from tableA where term_a in ( select term_a from tableA intersect select term_b from tableB ) ;
TABLEA から追加の列を選択する必要があるため、交差の出力をサブクエリとして使用する必要があります。