Home » SQL & PL/SQL » SQL & PL/SQL » Query help (Oracle 10 g)
Query help [message #305049] Fri, 07 March 2008 16:19 Go to next message
vinu_vkumar
Messages: 45
Registered: March 2005
Member
Hello All,
Kindly help me understand this query
SELECT
	MCUR.CASS_CODE, MCUR.ORIGIN_AIRPORT_CODE, 
	MCUR.DEST_AIRPORT_CODE, MCUR.BRANCH_OFFICE_CODE,
	MCUR.HEAD_OFFICE_CODE, MCUR.CURRENCY_CODE,MCUR.REPORTING_DATE,
	MCUR.REP_YEAR, MCUR.REP_MONTH, MCUR.CLASS_CODE,
	MCUR.MARKET_LOC_REVENUE AS MARKET_LOC_REVENUE_TP,
	MPRE.MARKET_LOC_REVENUE AS MARKET_LOC_REVENUE_LP,
	MCUR.MARKET_USD__REVENUE AS MARKET_USD_REVENUE_TP,
	MPRE.MARKET_USD__REVENUE AS MARKET_USD_REVENUE_LP,
	MCUR.MARKET_EUR_REVENUE AS MARKET_EUR_REVENUE_TP,
	MPRE.MARKET_EUR_REVENUE AS MARKET_EUR_REVENUE_LP,
	MCUR.MARKET_WGT AS MARKET_WEIGHT_TP,
	MPRE.MARKET_WGT AS MARKET_WEIGHT_LP,
	MCUR.MARKET_AWB_COUNT AS MARKET_AWB_COUNT_TP,
	MPRE.MARKET_AWB_COUNT AS MARKET_AWB_COUNT_LP
FROM
	Z_MARKET_SUMMARY_DOTNET_ALL MCUR,
	Z_MARKET_SUMMARY_DOTNET_ALL MPRE
WHERE
	MCUR.CASS_CODE=MPRE.CASS_CODE(+) AND
	MCUR.ORIGIN_AIRPORT_CODE=MPRE.ORIGIN_AIRPORT_CODE(+) AND
	MCUR.DEST_AIRPORT_CODE=MPRE.DEST_AIRPORT_CODE(+) AND
	MCUR.BRANCH_OFFICE_CODE=MPRE.BRANCH_OFFICE_CODE(+) AND
	MCUR.HEAD_OFFICE_CODE=MPRE.HEAD_OFFICE_CODE(+) AND
	MCUR.CURRENCY_CODE=MPRE.CURRENCY_CODE(+) AND
	MCUR.REPORTING_DATE=ADD_MONTHS(MPRE.REPORTING_DATE(+),12) AND
	MCUR.CLASS_CODE=MPRE.CLASS_CODE(+)

Particularly the line which is
MCUR.REPORTING_DATE=ADD_MONTHS(MPRE.REPORTING_DATE(+),12)..
the rest are all pretty straightforward..see that both the tables used are same.

Any help is appreciated.

Thanks in advance
Vinu

[Updated on: Fri, 07 March 2008 19:10] by Moderator

Report message to a moderator

Re: Query help [message #305054 is a reply to message #305049] Fri, 07 March 2008 19:08 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Please read the OraFAQ Forum Guide and learn to format your posts.

Check Outer Join and ADD_MONTHS for answers to your question.
Previous Topic: How to multiple columns into single row
Next Topic: Run PL SQL code from external file
Goto Forum:
  


Current Time: Wed Dec 07 08:27:25 CST 2016

Total time taken to generate the page: 0.13531 seconds