I'm refactoring some sql at work, and stumbled on something I'm not sure how to explain. There are two queries I thought would result in the same result, but don't, and I'm not sure why.
The queries are as follows:
select *
from TableA as a
left join TableB b on a.id = b.id and b.status in (10, 100)
select *
from TableA as a
left join TableB b on a.id = b.id
where b.status is null or b.status in (10, 100)
When will these not return the same result?