Home » SQL & PL/SQL » SQL & PL/SQL » nvl in where clause (oracle 10g)
nvl in where clause [message #323501] Wed, 28 May 2008 10:49 Go to next message
kang
Messages: 89
Registered: November 2007
Member
in where clause, you can use functions such as substring, etc.

as I know nvl is not working in where clause.
like
select some columns from sometable
where nvl(column,'N') = 'Y'

isn't it supposed to be used in where clause?

Thanks in advance.
Re: nvl in where clause [message #323504 is a reply to message #323501] Wed, 28 May 2008 10:53 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Works for me.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

SQL> SELECT * FROM dual
  2  WHERE Nvl(2,1) = 1;

no rows selected

SQL>
SQL> SELECT * FROM dual
  2  WHERE Nvl(NULL,1) = 1;

D
-
X

SQL>


Why do you think it isn't ?
Re: nvl in where clause [message #323571 is a reply to message #323504] Wed, 28 May 2008 20:54 Go to previous message
kang
Messages: 89
Registered: November 2007
Member
Yes you are right.
I have misunderstood.
Thanks.
Previous Topic: ora-01847 error, can't figure out why
Next Topic: how to find results of groups within groups without using analytic functions such as rank.
Goto Forum:
  


Current Time: Sun Dec 04 11:00:14 CST 2016

Total time taken to generate the page: 0.25659 seconds