re: What was your win this week? VIEW POST

FULL DISCUSSION
 

This week, I learned about using NOT EXISTS in a SQL subquery! I was able to use this to get rid of a left join and speed up a hairy database query 🎉🎉🎉 It really made my week lol. Also had a really good chat with a mentee about equivalence vs. equality in JS and Ruby!

insert-gif

 

I wish SQL had a negative join operation consistent with other join types because the fact that a NOT EXISTS subquery outperforms the outer join + null test approach just doesn't seem right.

 

I absolutely agree - I actually found this by googling "opposite of a join query" 😂 it would be cool to have an EXCLUDE operation or something similar

code of conduct - report abuse