Home > Database > Mysql Tutorial > Oracle PL/SQL之GROUP BY ROLLUP

Oracle PL/SQL之GROUP BY ROLLUP

WBOY
Release: 2016-06-07 16:46:09
Original
1353 people have browsed it

ROLLUP字面意思大概就是向上卷,用在GROUP BY 里面可起到累积求和的作用: 没有ROLLUP的情况下,以下查询按department_id和job_

ROLLUP字面意思大概就是向上卷,用在GROUP BY 里面可起到累积求和的作用: 

没有ROLLUP的情况下,以下查询按department_id和job_id进行分组求和:

Output:

有ROLLUP的情况下:

先对department_id和job_id进行分组求和,,再根据department_id累计求和,最后计算总和:

Output:

先对department_id和job_id进行分组求和,再根据job_id累计求和,最后计算总和:

Output:

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template