Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql update all records using data from a table
Message
De
08/09/1999 13:46:54
 
 
À
07/09/1999 12:16:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00261594
Message ID:
00262489
Vues:
19
>>>Is it possible to update all records of a table using an update something like:
>>>
>>>update table1 set field1 = select field1 from table2 where field2 = table1.field2
>>>
>>>The above does not work. Am I hoping for too much?
>>
>>I do not think subqueries are supported in VFP SQL Updates and Deletes. They are only supported in Selects.
>SQL DELETE will work on multiple records such as:
>DELETE FROM table1 WHERE somefield IN (SELECT otherfield FROM table2)
>unfortunately,
>SQL UPDATE works on only one record at a time.
>Use the REPLACE command which accepts a FOR clause.
Ignore what I said about SQL UPDATE which will work on multiple records and can use subqueries in its WHERE clause. It is SQL INSERT that will only operate one record per command execution.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform