Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Expand data with Select statement?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00805975
Message ID:
00806486
Vues:
15
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform