Monday, March 1, 2010

DECODE VS CASE in SQL

DECODE
It used in select state for the comparing values return by select statement.

Case
It is work look like Decode but it brought some power feature.
1. DECODE only work with select statement while CASE work in select and function/procedure for as passing parameters.
2. DECODE is poor in performance while CASE is efficient.
3. DECODE can't include any other select statement in it body! While CASE can do it.

1 comment:

  1. This post helps you distinguish between Decode and Case. Case is the term which I used in my query statements but never tried how Decode works. It seems quite similar with slight difference. I am going to check how it works.
    sap support pack stacks

    ReplyDelete