Home > Database > Mysql Tutorial > Oracle PL/SQL之GROUPING 函数

Oracle PL/SQL之GROUPING 函数

WBOY
Release: 2016-06-07 16:46:08
Original
1275 people have browsed it

在使用ROLLUP或CUBE进行GROUP操作时会产生内容为空的字段,即值为NULL的字段,那我们如何区分这些显示为空的字段到底是该字段本身

在使用ROLLUP或CUBE进行GROUP操作时会产生内容为空的字段,,即值为NULL的字段,那我们如何区分这些显示为空的字段到底是该字段本身值就是NULL还是由ROLLUP和CUBE生成的呢?

这时可以用GROUPING(groupingfield) 来解决,返回0表示该字段本身值就是NULL,返回1则表示是由ROLLUP或CUBE生成的。 

eg:

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