Purpose: Nested use of MySQL aggregate functions Aggregate functions cannot be nested directly, for example: max(count(*)) But you can use nested subqueries, eg: Note: The following as must be written
Supplementary knowledge: Tips for using the MAX() and count() functions in MySQL 1. max() function In the case of considering improving database IO, you can create an index ===> create index index name on table name (column name); 2. count() function Question: count(*) and count(column) * Includes null data in the table Tips: You can use this feature of count(*) to process instances that are counted according to different conditions: For example: Query the number of movies in 2006 and 2007 in one SQL statement ===>select count(release_year='2006' or null ) as 'Number of movies in 2006', count(release_year='2007' or null ) as 'Number of movies in 2007' from movies; The above article on nested use of MySQL aggregate functions is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: 10 Best Practices for Building and Maintaining Large-Scale Vue.js Projects
>>: Complete steps for using Nginx+Tomcat for load balancing under Windows
Record the installation and configuration method ...
Table of contents 2. Purpose 2.1 Adding propertie...
Install related dependencies npm i lib-flexible -...
This article discusses the difficulties and ideas...
1. How to monitor MySQL deadlocks in production e...
1. When designing a web page, determining the widt...
This article shares the specific code for JavaScr...
When learning kubernetes, we need to practice in ...
Use meta to implement timed refresh or jump of th...
Preface I believe that the syntax of MySQL is not...
I have been learning porters recently. I feel lik...
Table of contents Lazy Loading CSS styles: HTML p...
1. Why set maxPostSize? The tomcat container has ...
1. Introduction I have been studying the principl...
MySQL versions are divided into Enterprise Editio...