上传文件至 /

This commit is contained in:
2025-11-14 13:25:18 +08:00
parent 3e2c103361
commit 94f265660d
5 changed files with 131 additions and 0 deletions

20
数据库5.3.md Normal file
View File

@@ -0,0 +1,20 @@
# 一、聚合函数
常用的聚合函数:
1. count(\[ALL|DISTINCT]\*):统计元组数量
2. count(\[ALL|DISTINCT] 字段名):统计指定字段值的个数
3. sum(\[ALL|DISTINCT] 字段名):计算指定字段的值总和(此字段必須是數值型)
4. avg(\[ALL|DISTINCT] 字段名):計算指定字段的平均值(此字段必須是數值型)
5. max(\[ALL|DISTINCT] 字段名):求指定字段的最大值
6. min(\[ALL|DISTINCT] 字段名):求指定字段的最小值
# 二、分组查询
```sql
select from
[where ]
group by
[having ]
```
# 三、排序查询
```sql
select from
order by asc()|desc()[,2.....];
```