Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL-HELP

Re: SQL-HELP

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Mon, 17 Aug 1998 19:27:58 +0200
Message-ID: <6r9p5g$47b$1@newton.a2000.nl>


>Is there an equivalent in SQL to the case statement in C ?

Try decode:

    decode( my_col, 1, 'A', 2, 'D', 3, 'D', 4, 'C', 'Z' )

returns 'A' if my_col = 1, 'D' if it is 2, etc., or 'Z' if no match is found. You can not use decode in PL/SQL.

Arjan. Received on Mon Aug 17 1998 - 12:27:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US