Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select from a DBF table
Message
 
 
To
15/05/2019 13:20:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01668631
Message ID:
01668655
Views:
65
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
Previous
Reply
Map
View

Click here to load this message in the networking platform