Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert / Update
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01503367
Message ID:
01503370
Vues:
60
Something like
INSERT INTO TableA
SELECT * FROM TableB 
WHERE PK NOT IN (SELECT PK FROM TableA)
>Is there a way to “update” a table from another table appending or inserting only items that are not already in the target table with one function?
>Currently I create a cursor containing only those values not already in the target table, then scan it and do the insert function.
>
>This seems a little like brute force. Is there a more elegant way?
>
>I was looking at Update – SQL, but it seems it can only change existing field values.
>
>I was thinking something along these lines;
>
>Insert into A ;
>(F1, F2, F3) ;
>Where !F1 IN (select B.F1 from B)
>Values ;
>(B.F1, B.F2, B.F3)
>
>Thanks in advance
>
>Gary
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform