domiSchenk
domiSchenk

Reputation: 890

strange behavior with 'IN' clause works

i found this site: here

its very well described why it works and why not.

but my question is a little different.

select 'true' from dual where 'test' not in ('test2','');

why does this query not returing a row?
is '' handled like null?

thx for your help

Upvotes: 3

Views: 659

Answers (2)

user359040
user359040

Reputation:

Yes, in Oracle an empty string is a NULL.

Upvotes: 2

Martin Smith
Martin Smith

Reputation: 453287

Your suspicions were correct.

So your query is basically

WHERE 'test' <> 'test2' and  'test' <> Null

Which evaluates as

WHERE true and unknown

Which is unknown

select * from dual where '' = '';

will give the same (lack of) results

Upvotes: 12

Related Questions