8 Replies Latest reply: Feb 5, 2013 6:30 AM by _Karthick_ RSS

    Not Sure why this is not working

    prakash
      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