Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expand data with Select statement?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00805975
Message ID:
00806486
Views:
16
Hi Caroline,

You're welcome. If you do that offten, you may want to create permanent table (instead of crsTemp) filled with records and indexed on Qty which may speed up the query.

>That's brilliant Thanks Sergey.
>Now I've just got to confirm that it's faster with my data!
>Caroline
>>Hi Caroline,
>>
>>You can do that w/o SCAN
SELECT MAX(qty) as MaxQty ;
>>	FROM mytable ;
>>	INTO ARRAY laMaxQty
>>CREATE CURSOR crsTemp ( Qty I)
>>FOR i=1 TO laMaxQty[1]
>>	INSERT INTO crsTemp VALUES (i)
>>ENDFOR
>>
>>SELECT mt.Desc ;
>>	FROM mytable mt ;
>>		JOIN crsTemp ct ON ct.Qty <= mt.qty ;
>>	INTO CURSOR crsResult
>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform