Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL-HELP
>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
![]() |
![]() |