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

Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle sql

Re: oracle sql

From: jwa6 <jwagans_at_yahoo.com>
Date: 24 Aug 2005 06:47:40 -0700
Message-ID: <1124891260.144293.267390@g14g2000cwa.googlegroups.com>

DA Morgan wrote:
> jwa6 wrote:
> > select
> > PL.SYSTEM_CONTROL_NO AS "SCN",
> > PL.AGENCY_CASE_NO AS "OCA",
> > PL.AGENCY_ORI_NO AS "ORI",
> > PL.NCIC_NUMBER AS "NIC",
> > FTC.FILE_TYPE_DESCR AS "FILE TYPE",
> > comment_field as either "this is a ncic record" or
> > "this is a cbib record"
> > from
> > ANNUAL_PURGE AP,
> > PURGE_LOG PL,
> > FILE_TYPE_CODE FTC
> > where
> > ap.PURGE_RESULT_CD IN ('NCICN','CIBN') AND
> > PL.FILE_TYPE_CD = FTC.FILE_TYPE_CD
> > ORDER BY PL.AGENCY_ORI_NO, PL.FILE_TYPE_CD;
> >
> >
> > i need to do this if possible..if a record is
> > ap.PURGE_RESULT_CD ='NCICN' then the comment field in the select list
> > needs to read "this is a ncic record" or
> > if a record is
> > ap.PURGE_RESULT_CD ='CIBN' then the comment field in the select list
> > needs to read "this is a cbib record"
> >
> > is this possible in a single select?
> >
> > thanks
> > jwa
>
> Look up DECODE and CASE. Either will do what you appear to be asking.
>
> http://www.psoug.org
> click on Morgan's Library
> click on DECODE.
> --
> Daniel A. Morgan
> http://www.psoug.org
> damorgan_at_x.washington.edu
> (replace x with u to respond)

wonderful library!!!

thanks for your help! Received on Wed Aug 24 2005 - 08:47:40 CDT

Original text of this message

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