MySQL NOT IN from another column in the same table

后端 未结 5 2047
天涯浪人
天涯浪人 2021-02-09 00:32

I want to run a mysql query to select all rows from a table films where the value of the title column does not exist anywhere in all the values of anot

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-09 00:45

    SELECT * 
    FROM films 
    WHERE title NOT IN (SELECT collection FROM films where collection is not null);
    

    SQLFiddle: http://sqlfiddle.com/#!2/76278/1

提交回复
热议问题