Difference between NOT IN() AN NOT(COL1 IN))

Database

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?

Tags (2)
1 REPLY

Re: Difference between NOT IN() AN NOT(COL1 IN))

Hi.

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.

Cheers.

Carlos.