UPDATE file_material SET is_top = ( ( SELECT Max(is_top) FROM (SELECT * FROM file_material) AS x ) + 1 ) WHERE id = #{id}