1 Reply Latest reply: Sep 28, 2013 6:32 AM by Frank Kulash RSS

    Case stament

    a24a9f5f-0dd7-4c2f-b911-dd5d6d748ed4

      hi,

      can i write case statement in sql qry rather than decode..

       

      pls suggest me this..

        • 1. Re: Case stament
          Frank Kulash

          Hi,

           

          Sure; in Oracle 8.1 and higher, CASE can do anything that DECODE can do, and DECODE can do anything that CASE can do.

          Sometimes, DECODE involves a little less coding and is just as efficient.

          Other times, CASE involves much less coding, and is much more efficient.

           

          If you're having trouble using CASE, post an example.  Include your code, a little sample data (CREATE TABLE and INSERT statements, unless you're using commonly available tables, such as scott.emp), the results you want from that sample data, and an explanation of how you get those results from that data.

          Always say what version of Oracle you're using (e.g. 11.2.0.2.0).

          See the forum FAQ: https://forums.oracle.com/message/9362002