2014-02-25 46 views

回答

0

試試這個

Update table_name set col1 = rownum; 
0
with cte as(
    select col1, row_number() over(order by col1) rno 
    from #table_name 
) 
update cte set col1 = rno 
+0

哪些DBMS允許更新公用表表達式? –

+0

SQL服務器允許你執行這樣的事情 –