Nested DECODE?
From: S Fundarek <sfware_at_idirect.com>
Date: 1997/02/21
Message-ID: <330DC3BC.4ED8_at_idirect.com>#1/1
Date: 1997/02/21
Message-ID: <330DC3BC.4ED8_at_idirect.com>#1/1
[Quoted] Can anyone tell me if it is possible (and if so, how) to nest DECODE clauses within a select statement?
For example, I want to select a from tbla, except if a is null, then I want b from tblb, except if b is null then I want c from tblc.
This works:
select decode(a2,'', 'nu',a2) from asl where a1 = 'K1';
but if I try to replace 'nu' with a subselect-decode, it doesn't as given:
select decode(w2,'',
(select decode(a2,'','nu', a2) from asl where a1 = 'K1' )
, w2) from wms where w1 = 'K1';
Oracle returns ORA-00936: missing expression.
Any suggestions would be helpful
-steven
sfware_at_idirect.com
Received on Fri Feb 21 1997 - 00:00:00 CET