Please i need explanation...

I have this record...
DOB     ID     NAME     ADDRESS
12/16/2008 5:34:00 PM     2     name2     Address_2
02/26/2008 2:25:00 AM     3     name3     Address_3
12/18/2008 9:49:04 AM     4     name4     Address_4
12/18/2008 9:49:04 AM     5     name5     Address_5
02/25/2008 9:27:00 PM          name1     jdsfkljd
The result should not display a record which has an ID = 3. Therefore the result should display 4 records.
When I have this query SELECT * FROM TEMP WHERE ID !='3' . Why is it null ID record is not displaying? By right it should display.
DOB     ID     NAME     ADDRESS
12/16/2008 5:34:00 PM     2     name2     Address_2
12/18/2008 9:49:04 AM     4     name4     Address_4
12/18/2008 9:49:04 AM     5     name5     Address_5
But when i have this query SELECT * FROM TEMP WHERE ID != '3' OR ID IS NULL, record which has null ID displays. what is the explanation behind since ID IS NULL supposed not needed.
DOB     ID     NAME     ADDRESS
12/16/2008 5:34:00 PM     2     name2     Address_2
02/25/2008 9:27:00 PM          name1     jdsfkljd
12/18/2008 9:49:04 AM     4     name4     Address_4
12/18/2008 9:49:04 AM     5     name5     Address_5
Thanks....
Edited by: user10702626 on Jan 2, 2009 12:22 AM

in temp table, i put a space in ID which is blank. Look the record which is bold.
DOB     ID     NAME     ADDRESS
12/16/2008 5:34:00 PM     2     name2     Address_2
02/26/2008 2:25:00 AM     3     name3     Address_3
12/18/2008 9:49:04 AM     4     name4     Address_4
12/18/2008 9:49:04 AM     5     name5     Address_5
*02/25/2008 9:27:00 PM          name1     jdsfkljd*
After the query runs, it now displays a records which has ID empty.
DOB     ID     NAME     ADDRESS
12/16/2008 5:34:00 PM     2     name2     Address_2
02/25/2008 9:27:00 PM          name1     jdsfkljd
12/18/2008 9:49:04 AM     4     name4     Address_4
12/18/2008 9:49:04 AM     5     name5     Address_5
So the query will be correct when ID is a space rather null?
Thanks.

Similar Messages

Maybe you are looking for