SQL: select all records not selected by another query

前端 未结 3 1173
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 18:30

I am looking for an SQL query to select all records not selected by another query on the same table. Specifically I want to select all records which have duplicates of a pa

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 19:21

    If you change your not IN sub SELECT statement to only return one column (ID), it should work -

    http://blog.sqlauthority.com/2008/04/22/sql-server-better-performance-left-join-or-not-in/

提交回复
热议问题