Collections:
Group Functions with Non-group Selections in MySQL
Can Group Functions Be Mixed with Non-group Selection Fields in MySQL?
✍: FYIcenter.com
If a group function is used in the SELECT clause, all other selection fields must be group level fields. Non-group fields can not be mixed with group fields in the SELECT clause. The script below gives you an example of invalid SELECT statements with group and non-group selection fields:
mysql> SELECT COUNT(*), url FROM fyi_links; ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
In this example, COUNT(*) is a group field and "url" is a non-group field.
⇒ Dividing Query Output into Groups in MySQL
⇐ Using Group Functions in the SELECT Clause in MySQL
2017-10-16, 1732🔥, 0💬
Popular Posts:
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
What Happens If the Imported Table Already Exists in Oracle? If the import process tries to import a...
Collections: Interview Questions MySQL Tutorials MySQL Functions Oracle Tutorials SQL Server Tutoria...
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...