In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly gives you a brief introduction to the five aggregate functions of MySQL. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic of brief analysis of the five aggregate functions of MySQL. I hope we can bring you some practical help.
In order to get statistics quickly, five aggregate functions are provided.
* count () indicates that the total number of rows is calculated, and the star and column names are written in parentheses. The result is the same * *
Inquire about the total number of students
Select count (*) from students
Max (column) means to find the maximum value of this column
Query the maximum number of girls
Select max (id) from students where gender=0
Min (column) means to find the minimum value of this column
Query the minimum number of undeleted students
Select min (id) from students where isdelete=0
Subquery
Select * from students where id= (select min (id) from students where isdelete=0)
Sum (column) represents the sum of this column
After querying the boy's number
Select sum (id) from students where gender=1
Avg (column) means to find the average of this column.
Query the average number of undeleted girls
Select avg (id) from students where isdelete=0 and gender=0
This is the end of the brief analysis of the five aggregate functions of MySQL. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.