what is the use of decode function in sql and how to use decode function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • surendrareddy
    New Member
    • Dec 2011
    • 1

    what is the use of decode function in sql and how to use decode function

    wtat is the use of decode function ,how to use that function in sql

    description of decode function
    Last edited by Niheel; Dec 16 '11, 11:24 AM.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    In Oracle/PLSQL, the decode function has the functionality of an IF-THEN-ELSE statement.
    DECODE compares expression to each search value one by one. If expression is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.

    Please find more details here and here.

    Comment

    Working...