General information
Category:
Coding, syntax & commands
>>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only