| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re:SQL-Server SQL to Oracle SQL
Try looking at the decode function.
an eg might be
select decode(status,'shipping','TRUE','FALSE') from product;
In the above statement if status = shipping then it returns a TRUE
else
it returns a FALSE.
Oracle DBA/Support
Vinay Joshi
Pinnacle Insurance Plc
Vjoshi_at_pinnacle.co.uk
> -----Original Message-----
> From: Andy Hall [SMTP:andy.hall_at_bjss.co.uk]
> Posted At: 12 February 1998 15:25
> Posted To: server
> Conversation: SQL-Server SQL to Oracle SQL
> Subject: SQL-Server SQL to Oracle SQL
>
> Are there any multi-lingual SQL guys who can tell me how to code the
> following SQL-Server code in Oracle.
> The view contains a column ("available") which reduces the values
of
> the base table status column ("obsolete", "shipping", "beta", etc.)
to
> a boolean in the view.
> CREATE VIEW vwTmp (name, id, available) AS
> Select name,
> id,
> case when status = 'shipping' then true
> else false
> end
> From product
> GO
> Andy
Received on Thu Feb 12 1998 - 00:00:00 CST
![]() |
![]() |