1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Decode function

Discussion in 'SQL PL/SQL' started by nandhu, Jul 20, 2010.

  1. nandhu

    nandhu Active Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    55
    Hi ,

    Is it possible to use the decode function in the following way:

    decode (field1,1,TableA,0,TableB)


    Is it possible to have tablenames as result in decode expression.

    Thanks in advance for ur help..........
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    I don't understand what you want to accomplish; decode works on column values, not tables, but CAN return text when a condititon is met:

    decode(di.dirae,0,'DISABLED',1,'SEND',2,'RECEIVE',3,'ENABLED','UNKNOWN')

    Explain better what you want to do.
     
  3. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455