我想把左边的col3中生成右边的这种序号,有没有简单一点的办法啊?col1 col2 col3 col1 col2 col3
1 a 1 a 1
2 b 2 b 1
3 b 3 b 2
4 b 4 b 3
5 c 5 c 1
6 d 6 d 1
7 e 7 e 1
8 e 8 e 2
9 e 9 e 3
10 e 10 e 4
1 a 1 a 1
2 b 2 b 1
3 b 3 b 2
4 b 4 b 3
5 c 5 c 1
6 d 6 d 1
7 e 7 e 1
8 e 8 e 2
9 e 9 e 3
10 e 10 e 4
解决方案 »
- oracle调用webservice出现找不到服务的异常
- 连接ORACLE数据库出了问题,很奇怪的问题,请指教下。。。。
- 创建回退段的问题
- 不显示删除回复显示所有回复显示星级回复显示得分回复 RedHat 5 安装 Oracle10g,运行runinstaller 出错(带乱码
- toad的使用问题,急,在线等,先谢过!
- 求教Oracle数据库监听程序的问题
- 我恢复了一个数据库,为什么触发器不起作用了,我重编,什么都是好的,为什么??
- 大家来看看这个SELECT语句怎么了,谢谢谢谢 !!!
- 高分求LECCO SQL Expert For Oracal v3.2.1简体体中文版注册吗
- oracle语句未正确结束
- 今天的sql面试题
- 这样的查询怎么写?
col1 col2 col3 col1 col2 col3
1 a 1 a 1
2 b 2 b 1
3 b 3 b 2
4 b 4 b 3
5 c 5 c 1
6 d 6 d 1
7 e 7 e 1
8 e 8 e 2
9 e 9 e 3
10 e 10 e 4
update table a
set a.col3=(
select row_number() over(partition by b.col2 order by b.col1) col3 from table b
where a.col1=b.col1
)
(select col1, col2, row_number() over(partition by col2 order by col1) col3
from tb) t2
update tb t1 set t1.col3 = t2.col3
(select col1, col2, row_number() over(partition by col2 order by col1) col3
from tb) t2