Forum Moderators: open

Message Too Old, No Replies

Not in (null)?

         

NooK

11:23 am on Feb 22, 2008 (gmt 0)

10+ Year Member



I am trying to make a query with SQL Server.

I know I can do this

SELECT * FROM someTable WHERE someField IN (NULL)

This allows me to return an empty table if needed.

My problem is that the query bellow

SELECT * FROM someTable WHERE someField NOT IN (NULL)

Which I expect to do the opposite, to show all the records in the table, doesn't seem to do so.

It returns me an empty table. Does anybody know why this happens and how to counter it?

Due to programming I need to have the WHERE clause, so removing is not an option, I am just looking for a way a way to have the where clause show all results in the table.

syber

4:13 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



SELECT * FROM someTable WHERE 1=1

NooK

9:44 am on Feb 28, 2008 (gmt 0)

10+ Year Member



Thanks