NPL
NPL

Reputation: 39

How to test for NULL in SQL query

string query = 
  "select  User_name, User_Second_Choice 
   from tbl_User where User_Assigned_Project ='"+NULL+"'";

i try to select the rows to update so how can i change User_Assigned_Project = '"+NULL+"'";

Thank you.

Upvotes: 2

Views: 76

Answers (1)

David Ewen
David Ewen

Reputation: 3732

Use IS NULL not '= NULL'

select User_name, User_Second_Choice 
from tbl_User where User_Assigned_Project IS NULL

Upvotes: 6

Related Questions