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

Home -> Community -> Usenet -> c.d.o.server -> Re:SQL-Server SQL to Oracle SQL

Re:SQL-Server SQL to Oracle SQL

From: Vinay Joshi <vjoshi_at_pinnacle.co.uk>
Date: 1998/02/12
Message-ID: <717BDE76D864D011870F00A0C9283F1E12ABF2@exchange.pinnacle.co.uk>#1/1

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

Original text of this message

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