insert into t1 values(to_date('20130101','yyyymmdd'),(select count(*)+1 from t1 where t1.time=to_date('20130101','yyyymmdd')));
insert into t1 values(to_date('20130101','yyyymmdd'),(select count(*)+1 from t1 where t1.time=to_date('20130101','yyyymmdd')));
--sql:
update tab_time t
set num =
(select t3.cnt
from (select row_number() over(partition by t2.time order by t2.rowid) as cnt,
rowid as rid
from tab_time t2) t3
where t3.rid = t.rowid)
--result:
SQL> select * from tab_time;
TIME NUM
-------- ----------
20130101 1
20130101 2
20130102 1
20130102 2
20130102 3
20130103 1
可以在排序处换一下你想要的
row_number() over(partition by t2.time order by t2.xx)