= NULL
is always unknown
(this is piece of 3 state logic), but WHERE
clause treats it as false
and drops from the result set. So for NULL
you should use IS NULL
Reasons are described here: Why does NULL = NULL evaluate to false in SQL server
More Related Contents:
- Simulating group_concat MySQL function in Microsoft SQL Server 2005?
- How can I do an UPDATE statement with JOIN in SQL Server?
- The multi-part identifier could not be bound
- How to return multiple values in one column (T-SQL)?
- SQL – Subtracting a depleting value from rows
- Turn off constraints temporarily (MS SQL)
- Pass table as parameter into sql server UDF
- conditional unique constraint
- Can a Check constraint relate to another table?
- SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints
- How to Replace Multiple Characters in SQL?
- SELECT FOR UPDATE with SQL Server
- EXISTS vs JOIN and use of EXISTS clause
- SQL comma-separated row with Group By clause
- How to copy a huge table data into another table in SQL Server
- How to split string using delimiter char using T-SQL?
- Should I use SQL_Variant data type?
- Performance of SQL Server 2005 Query
- OPENXML with xmlns:dt
- SQL server select distinct rows using most recent value only
- Script to save varbinary data to disk
- Measuring Query Performance : “Execution Plan Query Cost” vs “Time Taken”
- How to select date without time in SQL
- What is the internal representation of datetime in sql server?
- Eliminate and reduce overlapping date ranges
- Cumulative Total in MS Sql server [duplicate]
- SQL query to group by day
- Export table data from one SQL Server to another
- SQL can I have a “conditionally unique” constraint on a table?
- SQL, How to Concatenate results?