当前位置:网站首页>SQL教程之 SQL 聚合函数入门教程
SQL教程之 SQL 聚合函数入门教程
2022-07-27 12:52:00 【知识大胖】
什么是聚合函数
它们是对一组行进行操作以计算并返回单个值的函数,我们在这里看到聚合函数:
- AVG():返回列的平均值。
- COUNT():返回列中的行数。
- MAX():返回列的最大值。
- MIN():返回列的最小值。
- SUM():返回列值的总和。
使用聚合函数
SQL 提供了用于汇总数据而不检索整个数据集的特殊功能。这是一个常见的要求。使用这些函数,SQL 查询经常用于检索数据以进行报告和分析。
注意:所有聚合函数都可用于使用标准数学运算符对多列执行计算,例如:AVG(prod_price*quantity).
功能 AVG()
AVG()此函数通过计算行数及其值的总和来返回列的平均值。AVG() 可用于返回特定列或行的平均值。
注意NULL:函数会忽略包含值的列行AVG()。

功能 COUNT()
COUNT()本质上,它很重要。您可以使用 COUNT() 函数确定表中的行数或满足特定条件的行数。
COUNT()可以通过 2 种方式使用:
用于COUNT()计算表中的行数,无论列是否包含值或NULL值。
用于COUNT(column)计算在特定列中具有值的行数,忽略NULL值。
注意NULL:函数会忽略包含值的列行COUNT(),但如果使用星号 (<
边栏推荐
- Vertical and horizontal shooting range - the mystery of the picture
- MTK6765编译环境搭建
- Relative positioning
- leetcode——83,24;机器学习——神经网络
- 2022acm summer training weekly report (IV)
- Li Hang, director of ByteDance AI Lab: past, present and future of language model
- Using ebpf to detect rootkit vulnerabilities
- 数据库内核开发人员,值一个马克杯!!!
- Redis summary: cache avalanche, cache breakdown, cache penetration and cache preheating, cache degradation
- 滑环的分类以及用途
猜你喜欢

How to debug JNI program

滑环使用如何固定

Pat class B 1109 good at C (detailed)

Li Hang, director of ByteDance AI Lab: past, present and future of language model

Preliminary discussion on NetGen and Gmsh mesh generation of any multiple sub models of CAD based on osg+occ

How to maintain slip ring equipment

Getting started for beginners: build your own blog with WordPress
![51: Chapter 5: develop admin management services: 4: develop [add admin account, interface]; (only [user name + password, method]; [@t...] annotation controls transactions; when setting cookies, do yo](/img/6f/4f93eca1d923a58b2ef4b1947538be.png)
51: Chapter 5: develop admin management services: 4: develop [add admin account, interface]; (only [user name + password, method]; [@t...] annotation controls transactions; when setting cookies, do yo

echart折线图默认显示最后一个点以及纵向虚线

Double material first!
随机推荐
期货手续费标准和保证金比例
Go语言系列:如何搭建Go语言开发环境?
Getting started for beginners: build your own blog with WordPress
Preliminary discussion on NetGen and Gmsh mesh generation of any multiple sub models of CAD based on osg+occ
JS divides the array into two-dimensional arrays according to the specified attribute values
滑环的分类以及用途
责任链模式在转转精准估价中的应用
How to debug JNI program
网络异常流量分析系统设计
Redis总结:缓存雪崩、缓存击穿、缓存穿透与缓存预热、缓存降级
C ftp add, delete, modify, query, create multi-level directory, automatic reconnection, switch directory
[basic knowledge] ~ IC design process and EDA tools used in each stage
Conditions and procedures of futures account opening
52: Chapter 5: developing admin management services: 5: developing [paging query admin account list, interface]; (swagger's @apiparam(), annotate the method parameters; PageHelper paging plug-in; Inte
[2023 Fudan Microelectronics written examination questions in advance] ~ questions and reference answers
libevent 之 evconnlistener_new_bind
【基础知识】~ 集成电路设计流程,以及各阶段所使用的EDA工具
Insert sort, positive order, reverse order
Come and watch, 17 practical skills of operation and maintenance~
附加:【URLEncoder.encode(待编码字符串, “编码方式“);】(是什么?;我们向cookie中设置值的时候,为什么要使用这个去编码?)(待完善……)