Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Decode
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C259C2.255CEE50
Content-Type: text/plain;
charset="iso-8859-1"
an example straight from 9i SQL Reference should do
SELECT product_id,
DECODE (warehouse_id, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non-domestic') quantity_on_hand FROM inventories;
-----Original Message-----
From: Ruth Gramolini [mailto:rgramolini_at_tax.state.vt.us]
Sent: Wednesday, September 11, 2002 2:59 PM
To: Multiple recipients of list ORACLE-L
Subject: Decode
Hello everyone,
I am having a senior moment and I have forgetten the syntax for 'decode'. Can anyone give me a hint. I have leant out my sql books and of course I need them now.
Thanks in advance,
Ruth Gramolini
Oracle DBA, Vermont Department of Taxes
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Ruth Gramolini INET: rgramolini_at_tax.state.vt.us Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------_=_NextPart_001_01C259C2.255CEE50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printableReceived on Wed Sep 11 2002 - 13:36:30 CDT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: Decode</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>an example straight from 9i SQL Reference should =
do</FONT>
</P>
<P><FONT SIZE=3D2>SELECT product_id,</FONT>
<BR><FONT SIZE=3D2> DECODE =
(warehouse_id, 1, 'Southlake', </FONT>
<BR><FONT =
SIZE=3D2> &nb= sp; &nb= sp; 2, 'San Francisco', </FONT>
<BR><FONT =
SIZE=3D2> &nb= sp; &nb= sp; 3, 'New Jersey', </FONT>
<BR><FONT =
SIZE=3D2> &nb= sp; &nb= sp; 4, 'Seattle',</FONT>
<BR><FONT =
SIZE=3D2> &nb= sp; &nb= sp; 'Non-domestic') =
</FONT>
<BR><FONT SIZE=3D2> =
quantity_on_hand FROM inventories;</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Ruth Gramolini [<A =
HREF=3D"mailto:rgramolini_at_tax.state.vt.us">mailto:rgramolini_at_tax.state.v= t.us</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, September 11, 2002 2:59 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Subject: Decode</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hello everyone,</FONT>
</P>
<P><FONT SIZE=3D2>I am having a senior moment and I have forgetten the =
syntax for 'decode'.</FONT>
<BR><FONT SIZE=3D2>Can anyone give me a hint. I have leant out my =
sql books and of course I</FONT>
<BR><FONT SIZE=3D2>need them now.</FONT>
</P>
<P><FONT SIZE=3D2>Thanks in advance,</FONT>
<BR><FONT SIZE=3D2>Ruth Gramolini</FONT>
<BR><FONT SIZE=3D2>Oracle DBA, Vermont Department of Taxes</FONT>
</P>
<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" = TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Ruth Gramolini</FONT>
<BR><FONT SIZE=3D2> INET: rgramolini_at_tax.state.vt.us</FONT>
</P>
<P><FONT SIZE=3D2>Fat City Network Services -- (858) =
538-5051 FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------= -----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an =
E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru_at_fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB =
ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed =
from). You may</FONT>
<BR><FONT SIZE=3D2>also send the HELP command for other information =