Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"NOT IN" clause Somebody kow why h 1

Status
Not open for further replies.

Iby

Programmer
Jul 17, 2002
18
0
0
IT
"NOT IN" clause using
Somebody kow why happen if I have a statement which do this:

SELECT * FROM OPDETM
WHERE WAREHOUSE not in ('dd','di','dx')

and then that statements which warehouse code is empty I don't get back from this select.

My question is how can I use this "not in" clause if I would like to see that warehouse also which is empty.
 
The idea is that comparison with null and even its negation in most cases returns false. The exception is IS [NOT] NULL. In your case you may use either NVL function or OR WAREHOUSE IS NULL condition.
 
Sem, how is this NVL function works?
 
NVL(parameter, value) returns value if parameter is null, otherwise it returns parameter.

WHERE nvl(WAREHOUSE,'aa') not in ('dd','di','dx') returns the result you need.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top