I have a table like this: ID PRODUCT DATEORDERED 1 5 2005-02-18 2 2 2008-03-13 3 2 2008-11-21 4 6 2009-01-21
A field has been added for current order to this table: ID PRODUCT DATEORDERED FLAGCURRENT I need to update all records in the table (about 400,000) so that the most current order has FLAGCURRENT=1 (else 0). Is there an optimal way of doing this with a single query?