Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Bases de datos, tablas, vistas, índices y SQL
Miscellaneous
ID de la conversación:
00343676
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
Responder
Ver el mapa de esta conversación
View the map of this thread starting from this message only
Ver todos los mensajes de esta conversación
Ver todos los mensajes de esta conversaicón a partir del actual