1。update tab a set col=(select num from (select rownum as num,id from tab) b
where b.id=a.id ) 
给某列值=行号(sql查询条件根据条件变化)