Difference between NOT IN and != ALL

programmer10 :

Does someone what is the difference between NOT IN and !=ALL.

JonnieJS :

It seems funny you are asking this question, since it literally says in the docs:

NOT IN is an alias for <> ALL. Thus, these two statements are the same:

SELECT s1 FROM t1 WHERE s1 <> ALL (SELECT s1 FROM t2);

SELECT s1 FROM t1 WHERE s1 NOT IN (SELECT s1 FROM t2);

For readability I would choose NOT IN, but it's your choice.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=386098&siteId=1