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

Retreiving distinct rows

From: Hitesh <zerocoo__at_hotmail.com>
Date: 10 Jun 2004 14:50:17 -0700
Message-ID: <30ca6fbb.0406101350.3687c3ef@posting.google.com>


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'}
Received on Thu Jun 10 2004 - 16:50:17 CDT

Original text of this message

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