Home » SQL & PL/SQL » SQL & PL/SQL » Decode Statement OR SubQuery
Decode Statement OR SubQuery [message #351031] Mon, 29 September 2008 01:16 Go to next message
saharookiedba
Messages: 56
Registered: September 2007
Location: PUNE
Member
Hi,

I am working on a Query, below is the example :-

DECODE 
( Jdate,
SELECT due_date FROM tbl_abc,
NULL,
SELECT last_date FROM tbl_xyz,
NULL,
SELECT 0 FROM dual
) 


here if the value that i get in due_date from tbl_abc is NULL, then i have to select a value from tbl_xyz..

i am trying it with DECODE, but not working...
is CO-Related Subquery the right option??

please suggest me..

thank you
Re: Decode Statement OR SubQuery [message #351034 is a reply to message #351031] Mon, 29 September 2008 01:19 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
CO-Related Subquery the right option??

There is no "correlation" in what you posted. Don't oversimplify your example it comes meaningless.
With your example, I should say use a factoring clause (WITH).

And "SELECT 0 FROM dual" is just silly, it is 0.

Regards
Michel
Previous Topic: whats wrong with this?
Next Topic: Merge Join Cartesian
Goto Forum:
  


Current Time: Tue Dec 06 00:19:17 CST 2016

Total time taken to generate the page: 0.06581 seconds