Click here to Skip to main content
15,913,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table
SQL
create table question
(
Q_no int primary key,
Question_title varchar(50),
Languagee varchar(30),
Question_body varchar(max),
Ans varchar(max),
UserName varchar(20)
)

in table I inserted a row
SQL
insert into question(Q_no,Question_title,Languagee,Question_body) values(1,'Problem in c sharp','c sharp','plz help me how can i get help in c sharp')


After that i want to execute the query.
SQL
select * from question where Ans=null

this query executes but it does not return any row.
plz help me.
Posted

I think you have default set up on Ans column in Question table.

It would be helpful if you can share table structure with us.

Hope this helps if yes then mark as answer and vote it.Any queries on the same are welcome
 
Share this answer
 
try :

SQL
select * from question where Ans IS NULL


for more refer:http://www.techrepublic.com/blog/datacenter/handling-null-values-in-sql-server-2005/153[^]
and many more from google
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900