>I cannot get it into one sql statement but here is a foxpro solution for the Date1 case:
>
>set enginebehavior 70
>
>select pk, max(Date1) from mytable where Flag=1 group by fk into cursor ctemp
>
>update mytable set Flag=0 where NOT pk in (select pk from ctemp)
I was thinking along these lines before, but may be because I was thinking too much or something I thought I can not do this this way. So I just went with SCAN/ENDSCAN solution.
If it's not broken, fix it until it is.
My Blog