Sign up, and you can customize which countdowns you see. Sign up
May 17, 2024
3:36:28pm
molodyets Slava Ukraini
There’s no reason to use both. One vs the other would depend on which list
(Stuff you want vs don’t want) you expect to grow.

If you have A, B and C and know that you will not want D and E, do IN (‘A’, ‘B’).

If you know you will want to keep D and E then do NOT IN C.

You also need to be mindful of null values. SQL Server has a global setting that will control if nulls are considered NOT IN or skipped and return a null value. That’s likely why the guy wants to use both - but it’s better to coalesce and make sure there’s no nulls or control for them separately to be explicit
molodyets
Previous username
patches1391
Bio page
molodyets
Joined
Mar 26, 2006
Last login
Jun 1, 2024
Total posts
43,459 (19,402 FO)