Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-Update From with missing records in the FROM-Table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL-Update From with missing records in the FROM-Table
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00977697
Message ID:
00977697
Views:
71
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.
Next
Reply
Map
View

Click here to load this message in the networking platform