Prevent Oracle minus statement from removing duplicates

前端 未结 7 1148
被撕碎了的回忆
被撕碎了的回忆 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 19:57

    Oracle supports multiple columns in the IN statement, so you can write:

    SELECT a, b, c
    FROM table1
    WHERE (a,b,c) not in (
        select a,b,c from table2
    )
    

提交回复
热议问题