Hot answers tagged

2

In your 1st query there's a NULL returned by the subquery and you're a victim of Three-valued-logic. See also: https://www.simple-talk.com/sql/learn-sql-server/sql-and-the-snare-of-three-valued-logic/ A simple workaround is to add WHERE propid IS NOT NULL. But better switch to NOT EXISTS instead, which treats UNKNOWN as FALSE (i.e. Two-valued-logic): ...



Only top voted, non community-wiki answers of a minimum length are eligible