But that will not return any results. The funny thing is there's no SQL error so you think that there's no results. However if you change the query to this
SELECT CompanyName, ContactName, ContactTitle,Region
FROM Customers
WHERE Region = NULL
You see there's plenty of records with Region IS NULL
SELECT CompanyName, ContactName, ContactTitle,Region
FROM Customers
WHERE Region IS NULL
The reverse is true if you want records that are not NULL you would not write the query like this
But you want to write the query like this instead
SELECT CompanyName, ContactName, ContactTitle,Region
FROM Customers
WHERE Region != NULL
SELECT CompanyName, ContactName, ContactTitle,Region
FROM Customers
WHERE Region IS NOT NULL
No comments:
Post a Comment