All Forums Database
boagus1 4 posts Joined 02/13
28 Jun 2016
Difference between NOT IN() AN NOT(COL1 IN))

A developer on our project is using logic that I can't find in any Teradata documentation, so I was hoping for some insight on it's performance.
NOT(ORDER_ID IN (2,3,4) is how it's coded.
ORDER_ID NOT IN (2,3,4) is how I've always seen this logic coded.
Oddly enough when testing, ORDER_ID NOT IN (2,3,4), I found records with ORDER_ID'S 2,3 AND 4.
Any ideas?

CarlosAL 512 posts Joined 04/08
29 Jun 2016

The two "IN" expresions are equivalent. Have you experienced any performance difference? If so, post the execution plan.
NOT IN is not the same as NOT EXISTS if NULLs are present. Again, post the actual sentence.

You must sign in to leave a comment.