Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting from one table to another
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00800915
Message ID:
00800934
Vues:
19
VFP7 and earlier
select last, .t. AS volunteer, person AS oldid ;
  from volunteer;
  where Person not in (select oldId from person);
  into CURSOR Temp
select person
append from ( DBF("Temp"))
USE IN Temp
VFP8
INSERT INTO person (last,first,volunteer,oldid);
SELECT (volunteer.last,volunteer.first,.t.,volunteer.person) ;
FROM volunteer ;
WHERE volunteer.person NOT IN (select oldid FROM person)
>In "there must be a way" department....
>
>I'm trying to copy volunteers from an old table, to a new table. Some of the records from the old table already exist in the new table.
>
>I'm looking to use a single SQL statement to insert records from one table that don't have a corresponding record in another table. something like:
>
>INSERT INTO person (last,first,volunteer,oldid);
>VALUES (volunteer.last,volunteer.first,.t.,volunteer.person);
>WHERE volunteer.person NOT IN (select oldid as person FROM person)
>
>
>Right now, I'm doing this with SCAN-ENDSCAN....and locate....the old dBase syntax.
>
>TIA
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform