Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querying null columns

Status
Not open for further replies.

aneev

Programmer
Jan 9, 2003
9
US
I have a query in which I need to find all the rows with a specific column being null.
Ex:
select count(*) from proposal_review_info where reviewerid='xyz' and status=1 and review_result='';
the above query does not work. What is the correct solution for the above query?
 
Null is not a value- it is the lack of a value. So you can't check to see if something equals null. Nothing equals null by definition. You need to use the IS NULL condition.

Code:
select count(*) from  proposal_review_info where reviewerid='xyz' and status=1 and review_result is null;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top