[20150205]分析函数ntile.txt
--同事要做一个批量修改操作,修改时间太长,需要分段修改并且提交.
--想到可以按照rowid分段.
--google 一些例子,做一些记录:
SELECT MIN (a), MAX (a), b
FROM (SELECT ROWID a, NTILE (3) OVER (ORDER BY ROWID) b FROM emp)
GROUP BY b
ORDER BY b;
MIN(A) MAX(A) B
------------------ ------------------ ----------
AAAR3xAAEAAAACXAAA AAAR3xAAEAAAACXAAE 1
AAAR3xAAEAAAACXAAF AAAR3xAAEAAAACXAAJ 2
AAAR3xAAEAAAACXAAK AAAR3xAAEAAAACXAAN 3
--这样就可以实现3段rowid.