SQL IS NOT NULL
Look at the following "Persons" table:
How do we select only the records with no NULL values in the "Address" column?
We will have to use the IS NOT NULL operator:
The result-set will look like this:
Look at the following "Persons" table:
P_Id | LastName | FirstName | Address | City |
| 1 | Hansen | Ola | Sandnes | |
| 2 | Svendson | Tove | Borgvn 23 | Sandnes |
| 3 | Pettersen | Kari | Stavanger |
How do we select only the records with no NULL values in the "Address" column?
We will have to use the IS NOT NULL operator:
| SELECT LastName,FirstName,Address FROM Persons WHERE Address IS NOT NULL |
The result-set will look like this:
LastName | FirstName | Address |
| Svendson | Tove | Borgvn 23 |
No comments:
Post a Comment