Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL-Update From with missing records in the FROM-Table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SQL-Update From with missing records in the FROM-Table
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
00977697
Message ID:
00977697
Vues:
72
I try to update one field of the Table1 from Table2:
Update ;
     Table1 ;
from ;
     Table2 ;
set ;
     FieldToBeUpdated = NVL(Table2.FieldToUpdateWith,"") ;
where ;
     Table2.KeyField = Table1.KeyField
That is easy, but I would like to enchance this SQL-Statement so that in all Records of Table1 that do not match the Where-Clause, the Table1.FieldToBeUpdated will be set to "", as in the statement:
Update ;
    Table1 ;
set ;
    FieldToBeUpdated="" ;
where ;
    Table1.KeyField not in ;
       (select KeyField from Table2)
But I'd like it all to be in one statement...

Thanks for help
Alexander Lerner
a_lerner@heinrich-schmid.de

The life is somewhat easier than it seems to be.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform