I have never seen this before and found it interesting so, I wanted to share it with you inquiring why the different behavior. (See that there is a LEFT JOIN involved.)
In my database, the following returns only one record:
select *
from
TableA a
left join TableB b on a.MyColumnID = b.MyColumnId
where 1=1
and b.IsActive = 1
On the other hand, this other script returns two records. the first one containing NULL in the IsActive field:
select *
from
TableA a
left join TableB b on a.MyColumnId = b.MyColumnId and b.IsActive = 1
where 1=1
I just found out that it does not return the same but, I do not know why. Anyone may know?