当前位置:网站首页>GBase 8s V8.8 SQL 指南:教程-6.1.1(1)
GBase 8s V8.8 SQL 指南:教程-6.1.1(1)
2022-04-22 05:24:00 【GBASE数据库】
6.1.1 GROUP BY 子句
GROUP BY 子句将表分为几组。此子句通常与为每个这样的组生成总结值的聚集函数组
合。编写 SELECT 语句中的某些示例显示了应用于整个表的聚集函数的用法。本章说明应
用于行组的聚集函数。
使用不带聚集的 GROUP BY 子句与在 SELECT 子句中使用 DISTINCT(或 UNIQUE)
关键字很相似。下列查询在选择特定列中描述。
图: 查询
SELECT DISTINCT customer_num FROM orders;
还可以按以下查询编写此语句。
图: 查询
SELECT customer_num FROM orders
GROUP BY customer_num;
图 1和图 2返回下列行。
图: 查询结果
customer_num
101
104
106
110
⋮
124
126
127
GROUP BY 子句将行收集到组中,因此每一组中的每一行具有相同的客户号。在没有选择
任何其它列的情况下,结束是唯一 customer_num 值的列表。
GROUP BY 子句的功能在将它与聚集函数配合使用时更明显
版权声明
本文为[GBASE数据库]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_47390342/article/details/124326425
边栏推荐
- Drawing scatter diagram with MATLAB
- Supporting early and scalable discovery of information websites
- The signature of the update package is inconsistent with that of the installed app
- Implementation of unity simple event system
- Aiming position of unity shooting game
- Delete Xunlei and see the uninstall residue in the folder right-click menu
- The code example of writing data into disk file is as follows:
- 13.9.1-PointersOnC-20220421
- MySQL installation and configuration - detailed tutorial
- [WPF] making navigation bar with RadioButton
猜你喜欢

abcabc

Detailed explanation of ten functional features of ETL's kettle tool

idea2021. 1. When writing SQL in mapper: unable to resolve column / table

Online Tetris with automatic hang-up source code

Mysql database for the 11th time

Tree array

13.9.1-PointersOnC-20220421

2022.2.14-2.27 responsibility chain mode

【WPF】UpdateSourceTrigger

Distributed transaction Seata
随机推荐
TCP three handshakes and four waves (2022.4.18-4.24)
My creation anniversary
【CANdelaStudio编辑CDD】-2.3-实现$27服务多个SecurityLevel之间的跳转(UDS诊断)
Summary of browser cross domain problems
Basic configuration of NP and OSPF
String and byte [] turn to each other
[C #] remodeling matrix (staggered array)
Codeforces Round #783 (Div. 2) ABCD
水处理控制系统采用信号隔离器解决因某些现场非电量安装条件的限制问题
AssetBundle packaging based on unitygameframework framework
Leetcode 1387. Sort integers by the power value
[C #] implementation scheme of singleton mode
[WPF] cascaded combobox
时间复杂度和空间复杂度
Shenzhen Xishuangbanna
Mysql database for the 11th time
Distributed transaction Seata
Aiming position of unity shooting game
Star Trek - Discovery - Season 3 final episode
Codeforces Round #784 (Div. 4) All Problems