 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How Groups function can be used in MySQL SELECT clause?
As we know that group function operates on the sets of value that is why if group functions will be used in SELECT clause then they will be used on the rows that meet the query selection criteria and the output of group functions will be returned as the output of the query.
Example
In the example below, we have used some group functions in a SELECT statement on the fields of ‘Student’ table and the output of the statement is the output of those group functions −
mysql> Select COUNT(Name), MIN(Id), AVG(Id), MAX(Id), COUNT(*) from Student; +-------------+---------+---------+---------+----------+ | COUNT(Name) | MIN(Id) | AVG(Id) | MAX(Id) | COUNT(*) | +-------------+---------+---------+---------+----------+ | 5 | 1 | 11.0000 | 20 | 5 | +-------------+---------+---------+---------+----------+ 1 row in set (0.03 sec)
Advertisements
 