Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL command help.
Message
From
24/03/2000 11:11:54
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00343676
Message ID:
00350020
Views:
36
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
Map
View

Click here to load this message in the networking platform