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: Retreiving distinct rows

Re: Retreiving distinct rows

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Thu, 10 Jun 2004 18:01:45 -0700
Message-ID: <1086915719.876477@yasure>


Hitesh wrote:

> A co-worker of mine is running this script. The query returns
> multiple rows per loan number because the SETDATA table can have
> different values. I would like to modify the script that one row per
> loan number is returned and that different SETDATA values are
> displayed horizontally, not vertically. How can I approach this
> problem, a decode statement? Thank you.
>
>
> SELECT
> T."AP_NUM",
> T."LOAN_AMOUNT",
> T."ADDRESS_NUM",
> T."ADDRESS",
> T."CITY",
> T."STATE",
> T."ZIP_CODE",
> T."COUNTY",
> T."FUNDED_DATE",
> T."TD_DATE",
> T."TITLE_POL_DATE",
> XREF."BORR_LAST_NAME",
> XREF."BORR_FIRST_NAME"
> MSDATA2."RECORDING_DT",
> MSDATA2."INSTRUMENT_NUM",
> SETDATA."TYPE",
> SETDATA."COMPANY",
> SETDATA."ADDRESS",
> SETDATA."CITY",
> SETDATA."STATE",
> SETDATA."ZIP",
> SETDATA."CONTACT",
> SETDATA."PHONE",
> SETDATA."FAX_PHONE"
>
> FROM
> "WINRLS"."T" T,
> "WINRLS"."XREF" XREF,
> "WINRLS"."MSDATA2" MSDATA2,
> "WINRLS"."SETDATA" SETDATA
>
> WHERE
> T."AP_NUM" = XREF."AP_NUM" (+) AND
> T."AP_NUM" = MSDATA2."AP_NUM" (+) AND
> T."AP_NUM" = SETDATA."AP_NUM" (+) AND
> (SETDATA."TYPE" = 8 OR
> SETDATA."TYPE" = 3 OR
> SETDATA."TYPE" = 12) AND
> T."FUNDED_DATE" < {ts '2003-06-01 00:00:00.00'}

A decode statement.

-- 
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 Thu Jun 10 2004 - 20:01:45 CDT

Original text of this message

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