Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: MSSQL Case equiv in Oracle (8.1.7.2.0)
James wrote:
> Thanks Daniel,
>
> The code was closer than i expected.
>
> SELECT priority =
> CASE
> WHEN (priority = '04-Medium' AND severity = '99') THEN 'URGENT'
> ELSE priority
> END
> FROM table_case
>
> Works a treat!
Glad it it works for you but it sure doesn't work for me the 9.2.0.4.
SQL> create table table_case (
2 priority VARCHAR2(20),
3 severity VARCHAR2(2));
Table created.
SQL> SELECT priority =
2 CASE
3 WHEN (priority = '04-Medium' AND severity = '99') THEN 'URGENT' 4 ELSE priority
*
What does work is:
SQL> SELECT
2 CASE
3 WHEN (priority = '04-Medium' AND severity = '99') THEN 'URGENT' 4 ELSE priority
SQL> Which is what I sent you.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Tue Jan 20 2004 - 20:11:43 CST
![]() |
![]() |