Database Reference
In-Depth Information
Figure 5-19.
Using the IS NULL operator
Try It: Using the IS NOT NULL Operator
Open a New Query window in SQL Server Management Studio. Enter the following query, and click
Execute. You should see the results shown in Figure 5-20.
select Title, FirstName, MiddleName, LastName
from Person.Contact
where MiddleName is not null
How It Works
You specify four columns of the Contact table.
select Title, FirstName, MiddleName, LastName
from Person.Contact
You specify the
WHERE
condition based on whether
MiddleName
is not null. Hence, it filters 11,473
records for the person's contact details; all the listed records have a defined
MiddleName
.
where MiddleName is not null