December 12, 2012 at 2:59 am
is there many type off null value?
i have table that have null value on 1 of my field.
ex:
id | Name | Info
----------------
01 | A | X
02 | B | null
03 | C | Y
when i try to select all data with null value on info, it didnt show any data or no data in the result.
but when i select all data, there is some data with null value.
i have try selecting with null, 'null', and '' but nothing works.
it happen on 1 of my table. with other table i can selecting data with null value without any problem.
thanks.
December 12, 2012 at 3:09 am
SELECT * FROM table WHERE info IS NULL
A NULL value can not be used in an equals operation as SQL doesnt know if NULL is < > or = to the value you want to compare it to, therefore you must treat is with IS NULL to or wrap the null column in ISNULL() which will then provide a value to the NULL column.
December 12, 2012 at 3:20 am
it seems that you are unaware of NULL keyword , take help from here
http://www.techrepublic.com/blog/datacenter/handling-null-values-in-sql-server-2005/153
PLUS
you query will work like this select * from table where info is null
BUT below wont work
select * from table where info = null
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply