General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>UPDATE MyTable SET Field3 = .T. WHERE NOT Field2 IN (SELECT Field2 FROM MyTable WHERE Field3)
This works in theory only:
suppose that every record field3 = .F.
..the subquery will yield no results, and the update will set every field3=.T.
Considering that MyTable is likely to start with field3 being unassigned and the records being added with possible dupes on field2, it is likely this statement will be toggling the field3 values.
The update sql is a great way to do this job, but like an SQL-Select, it takes a bit of tweaking before you get the correct results.
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