Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select from a DBF table
Message
 
 
À
15/05/2019 13:20:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01668631
Message ID:
01668655
Vues:
66
Simplest way (in VFP as well as in SQL Server) is to have a numbers table with all numbers and join with it.

>>Hi,
>>
>>Can I SQL Select from a DBF table and increase a number of records according to a column?
>>
>>Here is an example.
>>Table of the following structure:
>>
>>PART #      PART DESCR                QTY
>>'ABC'         Abc Part                       1
>>'CBS'         Cbs Part                       2
>>'NBC'        Nbc Part                       5
>>'ESPN"      ESPN Part                      0
>>NFL           NFL Part                      10   
>>
>
>I can't think of a way to do that with just SQL, but you can use SQL inside a loop.
>
>Tamar
>>
>>Then the resulting cursor should have the same structure (resulting cursor of temporary name). And the number of records would increase according to the QTY column. For example, part "NBC" would be entered 5 times (5 records). And ESPN 0 records.
>>
>>TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform