Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL append from one table to another table
Message
De
15/08/2005 18:46:54
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01041168
Message ID:
01041171
Vues:
22
>I have two identical tables and want to either merge them both into a new table, or append from one table to the other table. I have tried INSERT FROM TABLE, but can not get it to work. Also tried INSERT FROM ARRAY, but the two tables have their columns in slightly different order so copying to and from an array will not work.
>
>thanks
>
>Brenda
INSERT INTO anotherTable; && comment for a new table
SELECT FIELDLIST1 FROM TABLE1;
UNION ALL ; && remove ALL for distinct
SELECT FIELDLIST2 FROM TABLE2;
&& INTO TABLE NewTable  && uncomment for a new table
SELECT TABLE1
COPY TO NEWTABLE
SELECT 0
USE NEWTABLE
APPEND FROM TABLE2
INSERT INTO anotherTable;
SELECT FIELDLIST FROM oneTable
SELECT anotherTable
APPEND FROM oneTable
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform