update table_name set order_id = (select max(order_id) from table_name) + 1 where order_id = 0; also lots of other ways...