Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    14

    Wink Unanswered: Sybase similar function like Oracle decode

    Dear all,

    I'm new for sybase.

    For Oracle, we have

    select decode(status,'A','Active','Inactive)
    from order

    Is there a similare decode function in Sybase 12.

    Regards,

    Thomas HO

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    Use the "CASE" statement

  3. #3
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Show a sample output in Oracle and a brief description.

    We could easily write one to similar effect with Sybase.

  4. #4
    Join Date
    Nov 2002
    Posts
    207
    Sample case in Sybase would be...

    select case when status = "A" then "Active" else "Inactive" end as STATUS_CODE from ...

  5. #5
    Join Date
    Oct 2003
    Posts
    47
    Oracle also have introduced CASE in 9i version

  6. #6
    Join Date
    May 2004
    Posts
    14
    Thanks for all of you.

    It's working now !!

    Regards,

    Thomas HO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •