This content has been marked as final. Show 5 replies
The only thing I can see that's blatently wrong in your code is:
which would be better turned into a CASE statement so you can see the logic properly...
select decode ( LKP2.EXCLUDED_BOOK_CD, not null, ( select 1 from dual), 'NOTNULL','WHATEVER')
select case when LKP2.EXCLUDED_BOOK_CD is not null then '1' when LKP2.EXCLUDED_BOOK_CD = 'NOTNULL' then 'WHATEVER' else null end as result
Keith Jamieson wrote:Or the other way around perhaps?
SELECT CASE WHEN DUMMY = 'XY' THEN DUMMY ELSE NULL END selectvalue from dual
SELECT CASE WHEN DUMMY = 'X' THEN DUMMY ELSE NULL END selectvalue from dual
Edited by: Keith Jamieson on Nov 14, 2012 11:27 AM
SQL> SELECT 2 CASE WHEN DUMMY = 'X' 3 THEN 4 DUMMY 5 ELSE 6 NULL 7 END selectvalue 8 from dual 9 SQL> / S - X SQL> SELECT 2 CASE WHEN DUMMY = 'XY' 3 THEN 4 DUMMY 5 ELSE 6 NULL 7 END selectvalue 8 from dual 9 SQL> / S -