Another way to do a not exists SQL query with best performance

This comes up again and again as a thorny and persistent problem. I got this new way of doing this from my friend.

SELECT alias1.PKCol1, alias1.Col2
FROM table1 alias1
WHERE alias1.Col3= 11 AND alias1.Col4= 43 AND
      NOT EXISTS (SELECT 'x' FROM table2 alias2 WHERE alias2.PKCol1 = alias1.PKCol1)

Comments

Popular posts from this blog

Enable Visual Studio to use more than 2GB of memory

Firefox and Chrome dark mode

Dealing with the morons who built Dell 7710 and RAID