How to Use SQL INTERSECT to Work Around SQL’s NULL Logic

ANOTHER SQL Post this week? I got nerd-sniped: https://twitter.com/rafaelcodes/status/870574075244158980 Oooooh, challenge accepted! So, let's assume we have a table T with columns (A, B, C) like this: WITH t(a, b, c) AS ( SELECT 'a', 'b', null FROM dual UNION ALL SELECT 'a', null, 'c' FROM dual UNION ALL SELECT 'a', 'b', 'c' FROM dual … Continue reading How to Use SQL INTERSECT to Work Around SQL’s NULL Logic

SQL JOIN or EXISTS? Chances Are, You’re Doing it Wrong

I've noticed this very consistently with a lot of customers, and also with participants of our Data Geekery SQL Workshop (which I highly recommend to everyone, if you excuse the advertising): A lot of developers get the distinction between JOIN and SEMI-JOIN wrong. Let me explain... What are JOIN and SEMI-JOIN A little bit of … Continue reading SQL JOIN or EXISTS? Chances Are, You’re Doing it Wrong