Prevent Oracle minus statement from removing duplicates

前端 未结 7 1146
被撕碎了的回忆
被撕碎了的回忆 2021-02-15 19:13

Given these two tables:

CREATE TABLE TEST1 (TEST  VARCHAR2(1 BYTE))
CREATE TABLE TEST2 (TEST  VARCHAR2(1 BYTE))

Where TEST1 has two rows both w

相关标签:
7条回答
  • 2021-02-15 20:09
    SELECT field1 FROM table1 WHERE field1 NOT IN (SELECT field2 FROM table2)
    

    Will work so long as field2 can't contain NULLs.

    0 讨论(0)
提交回复
热议问题