This discussion is archived
8 Replies Latest reply: Feb 5, 2013 4:30 AM by Karthick_Arp RSS

Not Sure why this is not working

prakash Pro
Currently Being Moderated
hi all,
Version details :
----------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE     11.2.0.2.0     Production"
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Select * From Dual
Where 'A' In (Decode( 'A','A','''A'''
  ||','
  ||'''B''','C','C'));

Result :
   no rows
Select * From Dual
Where 'C' In (Decode( 'C','A','''A'''
  ||','
  ||'''B''','C','C'));

Result :
 Dummy
------------
   X
Please let me know why this is working like this ..

Problem:

When the input is 'A' then condition should be 'A' in ('A','B')
When the input is 'C' then condition should be 'C' in ('C')



Thanks,
P Prakash

Edited by: prakash on Feb 4, 2013 10:41 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points