Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Retreiving distinct rows
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" FROMReceived on Thu Jun 10 2004 - 16:50:17 CDT
"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'}