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
You always need data for development. As a server...
Written in front In the past and in the current p...
Why are the scroll bars of the browsers and word ...
I always feel that translate and transition are v...
When setting the text in the search text box, the...
Last night, I was looking at an interview question...
How does "adaptive web design" work? It’...
environment: 1. Windows Server 2016 Datacenter 64...
This article example shares the specific code of ...
1. Function : Allows the parent component to inse...
Recently I wrote in my blog that in the project l...
This article describes the commonly used MySQL fu...
Before starting the main text of this article, yo...
Table of contents background Solution New Questio...
Just like this effect, the method is also very si...