Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Heya Larry
Remember that SQL you helped me with recently. It works, but I'm not happy using 2 views to do it. I've come up with a very different version. Would you comment on the performance characteristics of this versus your old one?
FYI, the field names are not the real ones.
SELECT * FROM PARTS ;
LEFT OUTER JOIN PRICE_HISTORY ON PRICE_PART_FK = PART_PK ;
AND PRICE_EFFECTIVE <= ltPRICE_Effective ;
where ;
PART_PK = lcPART_PK ;
and PRICE_PART_FK + TTOC(PRICE_EFFECTIVE,1) IN ;
(SELECT PRICE_PART_FK + TTOC(MAX(PRICE_EFFECTIVE),1) ;
FROM PRICE_HISTORY ;
WHERE ;
PRICE_PART_FK = lcPART_PK ;
and PRICE_EFFECTIVE <= ltPrice_Effective ;
GROUP BY ;
PRICE_PART_FK ) ;
INTO CURSOR TEST
Thanks!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only