>You probably already knew that the SQL "SELECT" statement will accept a subquery in the WHERE clause, as in
>
>select * from myTable1 ;
> where myTable1.cField1 in ( select cField1 from myTable2)
>
>
>It turns out that you can do this in SQL "DELETE" and "UPDATE" commands too. This is implied in the VFP Help, but not explicitly stated. For example, you can:
>
>delete from myTable1 ;
> where myTable1.cField1 in ( select cField1 from myTable2)
>
>and you can
>
>update myTable1 set cField3 = "X" ;
> where myTable1.cField1 in ( select cField1 from myTable2)
>
>
>File it under "U", for "Useful, Someday It Might Be".
Thanks, Rick. These commands are very useful. In my experience the DELETE SQL with subquery is fast and straightfoward. UPDATE SQL ,on the other hand, is usually easier to code, understand and execute using Xbase REPLACE with appropriate relations set.