oracle 查询时产生序号

例子1:

select dense_rank() over(order by d.auditingdate) num, d.auditingdate, d.quesuser, d.quescontent, decode(d.questype, 1, '系统Bug', 2, '新增', 3, '修改', 4, '咨询', 5, '其它') type
from debugrecord d
where to_char(d.auditingdate,'yyyy-MM') = '2010-12'

例子2:

select rank() over(order by d.auditingdate) num, d.auditingdate, d.quesuser, d.quescontent, decode(d.questype, 1, '系统Bug', 2, '新增', 3, '修改', 4, '咨询', 5, '其它') type
from debugrecord d
where to_char(d.auditingdate,'yyyy-MM') = '2010-12'

 

例子1 遇到相同的值,序号不会跳值。

例子2 遇到相同的值,序号会跳值。

你可能感兴趣的:(oracle,咨询)