Amberjack
Amberjack

Reputation: 45

How to exclude 0 from my query, but include null?

I would appreciate a little help. Values in the column are 1, 0 and null. I want to write a condition where I exclude only 0, but rows with values 1 and null are included.

I did not think this would be a problem for me, but it is.

Thank you for your help!

Upvotes: 0

Views: 739

Answers (1)

Fahmi
Fahmi

Reputation: 37473

You can try the below -

select * from tablename
where column=1 or column is null

Upvotes: 1

Related Questions