Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the aggregate functions in SQLServer

Shulou Source: shulou.com Published: 2022-06-01 02:56:10 09月22日 Update

This article mainly introduces what are the aggregate functions in SQLServer. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

Aggregate function

The aggregate function calculates a set of values and returns a single value. With the exception of the count (count of items) function, all aggregate functions ignore null values (null) in their formulas. All aggregate functions are deterministic.

The average avg () is the sum of a set of numbers, and then divided by the number of null, the average is obtained.

Select avg (id) from test1 avg (column name)

Minimum value min () maximum value max ()

Select min (id) from test1select max (id) from test1

Summation sum ()

Select sum (id) from test1

Calculate the total count ()

Select count (id) from test1

Grouping

Count the total scores of students and sort select stu_id as student numbers, name as student names, SUM (Chinese + English + math + algebra) as total score from tb_stuAchievement ORDER BY total score DESCGROUP BY stu_id, name above are all the contents of this article "what are the aggregate functions in SQLServer"? thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Function student content average total score article statistics maximum minimum number algebra value interest individual name partner sum assembly total score Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL Shulou Tech Info Apple Linux