As an analytic function, RANK computes the rank of each row returned from a query with respect to the other rows returned by the query, based on the values of the value_exprs in the order_by_clause.
--返回工资第二高的员工
SELECT *
FROM (
SELECT employee_id, last_name, salary,
RANK() OVER (ORDER BY salary DESC) EMPRANK
FROM employees)
WHERE emprank = 2;
-- verify result
SELECT employee_id, last_name, salary,
RANK() OVER (ORDER BY salary DESC) EMPRANK
FROM employees;
--另外一个例子
SELECT department_id,last_name,salary,commission_pct,
RANK() OVER (PARTITION BY department_id
ORDER BY salary DESC, commission_pct) RANK
FROM employees;
分享到:
相关推荐
Method of analytic tableauxMethod of analytic tableauxMethod of analytic tableaux
Calculus with Analytic Geometry. 2nd ed. New York, NY: McGraw-Hill, October 1, 1995. ISBN: 0070576424. Readings in the textbook are listed by section numbers (e.g., § 2.1-2.4 means read sections ...
从官方文档了解到其的定义为:阿里云分析型数据库AnalyticDB(简称ADB),是云端托管的PB级高并发实时数据仓库,是专注于服务OLAP领域的数据仓库。在数据存储模型上,采用关系模型进行数据存储,可以使用SQL进行自由...
2019云栖大会-AnalyticDB-快数据时代的实时数据仓库技术内幕,一起来学习阿里巴巴PB级数据处理机制
AnalyticDB for MySQL基础版技术解密.pdf
Introduction to matrix analytic methods in stochastic modeling
Philippe Flajolet & Robert Sedewick的新作。
Google Analytics是著名互联网公司Google为网站提供的数据统计服务
AnalyticDB for MySQL基础版技术架构解密.pdf
阿里云AnalyticDB
提供组合法中分析方法的统一处理。 给出了许多与单词,整数组成和分区,路径和行走,图形,映射和分配,点阵路径,排列,树和平面图有关的示例。
资源分类:Python库 所属语言:Python 资源全名:trytond_analytic_account-5.0.5.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
Philippe Flajolet & Robert Sedewick的新作。
阿里云AnalyticDB+DataWorks企业数仓方案.pptx
analytic data sets. Inspired by the large amount of recent research on column-oriented stores, we have developed a new specialized analytic data engine tightly-coupled with the Tableau data ...
This talk will investigate the trade-offs between real-time transactional access and fast analytic performance from the perspective of storage engine internals. It will also describe Apache Kudu ...
bse,演化程序,双星演化,质量和金属丰度对双星演化的影响
基于AnalyticDB for MySQL构建实时数据仓库.pdf
Springer Undergraduate Mathematics Series(SUMS) SUMS11 Analytic Methods for Partial Differential Equations, Gwynne A. EvansJonathan M. BlackledgePeter D. Yardley (1999).pdf