Once again, "I've never seen this anywhere else, but it does make sense." 😊
@Sttuey
4 жыл бұрын
Very good, I was well aware using inline functions such as isnull is a common antipattern for sargability but have never considered using intersect to work around joining on nullable columns - I'm definitely going to add that to my toolbox, thanks!
@danielheydt9864
4 жыл бұрын
Very clever solution! I have a few queries used in my application that could use this method. Thanks for the awesome advice.
@31redorange08
4 жыл бұрын
Very good alternative to the missing IS NOT DISTINCT FROM.
@ameobiamicrobiological2366
4 жыл бұрын
Thanks, I'm liking these videos!
@abhisheksengupta4314
3 жыл бұрын
just awesome
@hovardlee
2 жыл бұрын
You can try also with decode or case but joining on nulls ussually means problems with design :)
@BeardedDevData
2 жыл бұрын
Decode is not available in SQL Server, both IIF or CASE could be used but would pose the same problems either with performance or amount of code if comparing multiple columns. You could argue its a problem with design but doesn't solve the problem if you need to write the query and the database exists.
@hovardlee
2 жыл бұрын
@@BeardedDevData I used decode in Oracle and it worked better than is null or is not null. I know this pain when design team has its own vision and you have to solve its mistakes. It depends how many columns with nulls you have and how the design looks. Also sometimes when you develop it is hard to predict which option will be more efficient in the future :)
@superfreiheit1
Жыл бұрын
Do you know a good site for advance SQL exercises?
@BeardedDevData
Жыл бұрын
Have you got any ideas of what you would like to learn? Reason I ask is I've had to take a break due to a new addition to the family and work commitments but I'm starting to brainstorm some ideas for new videos and will be uploading more regular content in the next couple of weeks.
@houstonvanhoy7767
Жыл бұрын
@@BeardedDevData Congratulations on the new baby or puppy or whatever! 1. Lots of content creators are doing sessions about #ChatGPT. You might to create something on using ChatGPT to boost SQL coding productivity and accuracy., making the point that we need to know what we are doing and that ChatGPT can produce authoritative, convincing answers which are wrong. 2. You might want to create something on using #Git and #Github.
@coolblue5929
3 жыл бұрын
Since the query plan is the same, is it just for readability?
@BeardedDevData
3 жыл бұрын
Absolutely, just an alternative way to write the query but I think it looks cleaner especially if you want to compare a lot of NULLable columns.
Пікірлер: 14