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, 2523🔥, 0💬
Popular Posts:
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...