Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update column in Table1 with data from Table2
Message
De
17/11/2004 16:16:12
 
 
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
OS:
Windows 2000 SP4
Database:
Oracle
Divers
Thread ID:
00962384
Message ID:
00962402
Vues:
7
Hello,

UPDATE Table1 SET Table1.Staff_ID = (SELECT Table2.KeyID FROM Table2 WHERE Table2.Location = Table1.Location)

if there is not a 100% 1-1 relation between the Location fields you might want to add

WHERE EXISTS (SELECT Table2.KeyID FROM Table2 WHERE Table2.Location = Table1.Location)

otherwise some rows might be overridden with NULL values

Regards

Christian
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform