Message-ID: <18678335.1075841424615.JavaMail.evans@thyme>
Date: Thu, 27 Sep 2001 15:21:46 -0700 (PDT)
From: phillip.platter@enron.com
To: john.oh@enron.com
Subject: 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-From: Platter, Phillip </O=ENRON/OU=NA/CN=RECIPIENTS/CN=PPLATTE>
X-To: Oh, John </O=ENRON/OU=NA/CN=RECIPIENTS/CN=Joh2>
X-cc: 
X-bcc: 
X-Folder: \ExMerge - Platter, Phillip\Sent Items
X-Origin: PLATTER-P
X-FileName: phillip platter 6-26-02.PST

Select Lkp.DateValue, Lkp.YearNum, Lkp.MonthNum, Lkp.DayOfWeekName, DA..ZoneCode, DA.PeakOrOffPeak, DA.Price, RT.RTBID,RT.RTOffer,ISO.Inc, ISO.Dec
from(select cadatetime,peakoroffpeak,zonecode,price
from west_spotindex
where cadatetime>'8/31/2001'
group by cadatetime,peakoroffpeak,zonecode,price)da,
(Select Lkp.DateValue, Lkp.PeakOrOffPeak, RT.Entity, Avg(RT.Bid) RTBid, Avg(RT.Offer) RTOffer
From CA_HourlyBidOffer RT, LkpCalendar_Definitions Lkp
Where Lkp.DateTimeValue = RT.CADateTime
and lkp.datevalue>'8/31/2001'
Group By Lkp.DateValue, Lkp.PeakOrOffPeak, RT.Entity)RT,
(Select Lkp.DateValue, Lkp.PeakOrOffPeak, lkpzone.deliverypoint, avg(ISO.PriceInc) Inc, Avg(ISO.PriceDec) Dec
From LkpCalendar_Definitions Lkp, CA_ISOExPost10Price ISO, lkpCA_Zonecodes lkpzone
Where Lkp.DateTimeValue = ISO.CADateTime
and iso.zonecode = lkpzone.zonecode
and lkp.datevalue='9/1/2001'
Group By Lkp.DateValue, Lkp.PeakOrOffPeak, lkpzone.deliverypoint)ISO, LkpCalendar_Definitions lkp
Where DA.zonecode=RT.entity
And DA.zonecode=ISO.deliverypoint
and DA.cadatetime=RT.datevalue
and DA.cadatetime=ISO.datevalue
and DA.PeakorOffPeak=RT.PeakorOffPeak
and DA.PeakorOffPeak=ISO.PeakorOffPeak
and lkp.datevalue=da.cadatetime
and lkp.datevalue=rt.datevalue
and lkp.datevalue=iso.datevalue
ORDER BY LKP.DATEVALUE