November 6, 2007 at 7:32 am
You could try something like this:
INSERT CruiseOffersTmp
(
voyageNumber,
departureAirport,
duration,
departureDate,
availability,
cabinGrade,
cruiselineID,
cruiseshipID,
bestPrice,
brochurePrice,
uploadEntryDate,
flyCruise
)
SELECT
pt.Cruise_Number,
pt.Embark_Date,
pt.Air_City,
pt.Air_Indicator,
pt.category,
am.cruiseLineId,
pt.Category_Status,
pt.Best_Price,
pt.Brochure_Price,
pt.Duration,
cgv.ship_code,
cgv.brand
FROM Princess1Tmp pt
INNER JOIN
CarnivalGroupVoyageDataTmp cgv ON
cgv.voyage_code = pt.Cruise_Number
inner join
amCruiseShips am on
am.code = cgv.ship_code
WHERE cgv.brand = 'PC' and am.cruiseLineID = 13
[edit]
seeing both on screen at the same time I can see that some of the columns are rearranged but you should get the idea..
[/edit]
November 6, 2007 at 8:57 am
Thanks for your help John, the SQL statement does the insert in 12 seconds.
Good work! 😀
November 6, 2007 at 9:03 am
Good stuff.. but please check the data is consistent with what you expect.. cheers jd..
November 6, 2007 at 9:07 am
Yes it is, the only thing I had to do was add distinct to the select statement and of course rearrange some of the columns.
Thanks again for your help
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply