Home > Database > Mysql Tutorial > sql rollup用法 小计汇总

sql rollup用法 小计汇总

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 18:04:14
Original
1177 people have browsed it

rollup在oracle ,sql-server里面都有有。

结果:

广东 10
江苏 7
陕西 9
合计 26


结果:

广东 东莞 3
广东 广州 5
广东 珠海 2
广东 NULL 10
江苏 南京 6
江苏 苏州 1
江苏 NULL 7
陕西 安康 4
陕西 汉中 2
陕西 西安 3
陕西 NULL 9
NULL NULL 26


结果:

广东 东莞 3 0 0
广东 广州 5 0 0
广东 珠海 2 0 0
广东 NULL 10 0 1
江苏 南京 6 0 0
江苏 苏州 1 0 0
江苏 NULL 7 0 1
陕西 安康 4 0 0
陕西 汉中 2 0 0
陕西 西安 3 0 0
陕西 NULL 9 0 1
NULL NULL 26 1 1


结果:

广东 东莞 3
广东 广州 5
广东 珠海 2
广东 小计 10
江苏 南京 6
江苏 苏州 1
江苏 小计 7
陕西 安康 4
陕西 汉中 2
陕西 西安 3
陕西 小计 9
合计 NULL 26

Related labels:
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
Latest Issues
sql file
From 1970-01-01 08:00:00
0
0
0
php - Overhead of prepare vs sql?
From 1970-01-01 08:00:00
0
0
0
Print sql statement
From 1970-01-01 08:00:00
0
0
0
Pass array to SQL insert query using PHP
From 1970-01-01 08:00:00
0
0
0
sql optimization or
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template