Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from SQL cursor
Message
From
07/01/2000 17:16:27
 
 
To
07/01/2000 16:57:17
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00314771
Message ID:
00314785
Views:
40
>I want the output from 3 SQL Selects in 1 file. What's the simplest way to do this?
>
>Select ... into DBF [A|B|C]
>then append from [A|B|C]
>then delete [A|B|C]
>
>'seems like too much overhead; especially on disk accesses.
>
>I tried "Select * from a,b,c into cursor qcOutput", but i ended up with 27 records instead of 9. I know the extra records are partially because i have no join condition. What is the syntax to fix this?


SELECT ... FROM origtable WHERE condition1 ;
UNION SELECT ... FROM origtable WHERE condition2 ;
UNION SELECT ... FROM origtable WHERE condition3 ;
INTO TABLE newversion


This will work as long as all 3 selects are taking the same fields from the original table, making it UNION compatible.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform