Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL command help.
Message
De
24/03/2000 11:11:54
Mike Yearwood
Toronto, Ontario, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00343676
Message ID:
00350020
Vues:
37
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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform