Chitra
Chitra

Reputation: 21

How get the columns of table where column of datatype int is null?

select * from tblCustomerAdmin 
where  ReqCon=null or ReqCon=0 

Even though I've got data where ReqCon =NULL, I'm not getting any rows displayed.

Upvotes: 0

Views: 77

Answers (2)

Ocaso Protal
Ocaso Protal

Reputation: 20265

If you want to check if a value is NULL you have to use IS NULL, because comparison operators (=, !=) return UNKNOWN if either or both arguments are NULL:

SELECT * FROM tblCustomerAdmin 
WHERE ReqCon IS NULL OR ReqCon=0 

Upvotes: 2

Ashley John
Ashley John

Reputation: 2453

select * from tblCustomerAdmin where ReqCon is NULL or ReqCon =0

Upvotes: 2

Related Questions