当前位置:网站首页>SQL tutorial: introduction to SQL aggregate functions
SQL tutorial: introduction to SQL aggregate functions
2022-07-27 13:46:00 【Knowledge fatness】
What are aggregate functions
They are functions that operate on a set of rows to calculate and return a single value , We see the aggregate function here :
- AVG(): Returns the average value of the column .
- COUNT(): Returns the number of rows in the column .
- MAX(): Returns the maximum value of the column .
- MIN(): Returns the minimum value of the column .
- SUM(): Returns the sum of column values .
Using aggregate functions
SQL Provides special functions for summarizing data without retrieving the entire data set . This is a common requirement . Use these functions ,SQL Queries are often used to retrieve data for reporting and analysis .
Be careful : All aggregate functions can be used to perform calculations on multiple columns using standard mathematical operators , for example :AVG(prod_price*quantity).
function AVG()
AVG() This function returns the average value of the column by calculating the sum of the number of rows and their values .AVG() It can be used to return the average value of a specific column or row .
Be careful NULL: The function ignores columns and rows that contain values AVG().

function COUNT()
COUNT() Essentially , It is very important . You can use COUNT() Function to determine the number of rows in the table or the number of rows that meet specific conditions .
COUNT() Can pass 2 How to use :
be used for COUNT() Count the number of rows in the table , Whether the column contains values or NULL value .
be used for COUNT(column) Calculate the number of rows with values in a particular column , Ignore NULL value .
Be careful NULL: The function ignores columns and rows that contain values COUNT(), But if you use an asterisk (<
边栏推荐
- Software testing system architecture designer concise tutorial | software testing
- Seata's landing practice in ant International Banking
- 【每日一题】1206. 设计跳表
- Database kernel developer, worth a mug!!!
- [basic knowledge] ~ IC design process and EDA tools used in each stage
- js回调函数(callback)
- 使用碳刷的注意事项有哪些
- Echart line chart displays the last point and vertical dotted line by default
- Construction and application of industrial knowledge atlas (2): representation and modeling of commodity knowledge
- Dat.gui control custom placement and dragging
猜你喜欢

How can electric complete set enterprises do well in cost and profit management with the help of ERP system?

Cute image classification -- a general explanation of the article "what are the common flops in CNN model?"

js基础知识整理之 —— 数组

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

Interviewers often ask: how to set up a "message queue" and "delayed message queue"?

期货开户的条件和流程

我们要学会查看技术细节点的文档化说明

网络异常流量分析系统设计

JS divides the array into two-dimensional arrays according to the specified attribute values

滑环的分类以及用途
随机推荐
Product manager experience 100 (XI) - Strategic Product Manager: model and methodology
leetcode——83,24;机器学习——神经网络
剑指Offer 07 重建二叉树 -- 从中序与后序遍历序列构造二叉树
使用RecyclerView,实现列表左滑菜单
7.26 simulation summary
2022年7月24日 暑假第二周训练
Evconnlistener of libevent_ new_ bind
Cute image classification -- a general explanation of the article "what are the common flops in CNN model?"
Training in the second week of summer vacation on July 24, 2022
双料第一!
MySQL startup options and configuration files
【C语言入门】ZZULIOJ 1021-1025
Database kernel developer, worth a mug!!!
ThinkPHP+宝塔运营环境实现定时任务
English grammar_ Personal pronoun
产品经理经验谈100篇(十一)-策略产品经理:模型与方法论
滑环使用如何固定
Using ebpf to detect rootkit vulnerabilities
【C进阶】指针数组 VS 数组指针
C# FTP增、删、改、查、创建多级目录、自动重连、切换目录