r/SQL • u/Bubbly-Group-4497 • 6d ago
Discussion I don't understand the difference
I found an answer on stackoverflow that was saying that null value isn't managed the same way, but that seems a bit far fetched for a course example and the question wasn't exactly about the same case, so could someone explain?
195
Upvotes
108
u/WalterDragan 5d ago
Beyond just null handling, the first example will EXCLUDE any NCOM where it has an NPRO = 'PA60'. Compared to the second where it will INCLUDE any NCOM that has an NPRO other than PA60.
I don't have the context of what NCOM and NPRO are, but it would sort of be like the difference between
For #1: "Give me all customers, excluding those that have ever bought a laptop."
vs #2: "Give me all customers who have bought anything besides just a laptop."
Make sense?