加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle中over()分析函数的用法

发布时间:2020-12-12 18:47:21 所属栏目:百科 来源:网络整理
导读:oracle函数row_number() over ( )的简单使用 转载:http://jingyan.baidu.com/article/b2c186c82c4f50c46ef6ff1b.html 对于oracle的系统函数row_number() over (partition by para1 order by col1[col2...] [desc|asc]) 的简单用法 工具/原料 oracle pl/sql

oracle函数row_number() over ( )的简单使用

转载:http://jingyan.baidu.com/article/b2c186c82c4f50c46ef6ff1b.html


对于oracle的系统函数row_number() over (partition by para1 order by col1[col2...] [desc|asc]) 的简单用法

工具/原料

  • oracle
  • pl/sql developer
  • windows操作系统
方法/步骤
  1. 首先选择一张合适的表,如果没有,在当前用户有权限的前提下建立一张表,并导入少量数据,示例使用的表名字是test,可以看到,id和部门的排列毫无规律

  2. 先说一下函数的意思吧,row_number() over (partition by para1 order by col1【col2...】【asc|desc】) 说的是将查询结果按照para1字段分区,然后每个分区里面的数据再按照col1、col2、的优先级顺序排序, 至于asc 和desc 就是升序和降序了,可以不写,默认是asc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读