user4244510
user4244510

Reputation: 79

Check if either column is null

I want to check if either of the columns App.Person1 or App.Person2 have null in them.

Here is my query:

select App.ID, App.Firstname, App.Lastname, App.Email, App.Person1, App.Person2 
from App 
where (App.Person1 OR App.Person2 IS NULL)

Problem is that it won't return any rows.

Upvotes: 1

Views: 279

Answers (1)

Taras Velykyy
Taras Velykyy

Reputation: 1801

SELECT ID, Firstname, Lastname, Email, Person1, Person2 
FROM App 
WHERE Person1 IS NULL OR Person2 IS NULL

Upvotes: 1

Related Questions