![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
orcale
orcale
谢进进
这个作者很懒,什么都没留下…
展开
-
ORCALE 分组统计函数 rollup
ROLLUP 生成的结果集显示了所选列中值的某一层次结构的聚合。 select mm,sum(1) from T_BIS_YH group by ROLLUP(mm); 相较于group by,多了一行汇总数据原创 2021-12-30 19:08:36 · 51 阅读 · 0 评论 -
ORCALE 分析函数 lag lead
Lag函数可以在一次查询中取出当前行的同一字段的前面第N行的数据。 select id,cjsj,lag(cjsj,1,'') over ( order by cjsj desc) from table; Lead函数可以在一次查询中取出当前行的同一字段的后面第N行的值。 select id,cjsj,lead(cjsj,1,'') over ( order by cjsj ) from table; 第一个参数是字段,第二个参数是往上或者往下的偏移量,第三个参数是超出范围时的默认值 ...原创 2021-12-30 18:48:27 · 148 阅读 · 0 评论 -
ORCALE 树形查询
select * from t_zz start with pIdis null connect by pId = id;原创 2021-12-30 18:36:52 · 128 阅读 · 0 评论 -
ORCALE 开窗函数 over
row_number 得到排序结果的序号,对重复值进行顺延。 select JG,GL,row_number() over (partition by JG order by GL) as row_nfrom T_BIS_YH; rank 得到排序结果的排名号,如果有两个第二名的话,就不会有第三名,有三个第二名就不会有第四名。 select JG,GL,rank() over (partition by JG order by GL) as rank from T_...原创 2021-12-30 18:23:36 · 135 阅读 · 0 评论 -
ORCALE 查询重复数据
select namefrom table group by namehaving count(*) > 1原创 2021-12-29 18:48:47 · 201 阅读 · 0 评论