General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>UPDATE myTable SET mytable.field3 = .t. WHERE field2 in (SELECT field2 from myTable GROUP BY Fileld2)
I tried something like that in VFP6SP3 and it kep telling me that the subquery was invalid. I tried the subquery as a main query, and it executed properly.
Given that the end result is to have field3=.T. for those records whose field2 value does not occur anywhere else (field2 is unique) the subquery needs to be more like:
Update mytable set field3=.T. where field2 in (Select field2, CNT(FIELD2) as F2CNT from myTable group by field2 HAVING F2CNT=1)
This syntax would be ideal, but i couldn't make it work- so i offered an xBase solution which is probably an order of magnitude more clumsy.
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