Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from SQL cursor
Message
De
07/01/2000 17:16:27
 
 
À
07/01/2000 16:57:17
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00314771
Message ID:
00314785
Vues:
39
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform