Thursday, June 19, 2008

select null values

select null values:

Today, I had faced strange problem. I have a table with a coloumn which can have YES, NO or NULL. We want to give a choice to user from webinterface that user can either select 'YES' or 'NO' or NULL.

I can put where clause easily for YES or NO values. But I had hard time, how to select only null values. Please don't say use IS NULL. I want ony one where condition to select either "YES" or "NO" or NULL. We can't use IS NULL there.


Here is the solution finally I found:

decode(scan,:scan,1)=1

No comments: