Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL #1140 - Mixing of GROUP columns

Hi wondering if perhaps someone could shed some light on the below error. The sql works fine locally but i get the the below error remotely.

SQL query:

   SELECT COUNT(node.nid), 
          node.nid AS nid, 
          node_data_field_update_date.field_update_date_value AS node_data_field_update_date_field_update_date_value
     FROM node node
LEFT JOIN content_type_update node_data_field_update_date ON node.vid = node_data_field_update_date.vid
    WHERE node.type IN ('update')
ORDER BY node_data_field_update_date_field_update_date_value DESC

MySQL said:

#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause`

like image 309
frosty Avatar asked Aug 07 '09 11:08

frosty


People also ask

What is MySQL used for?

MySQL creates a database for storing and manipulating data, defining the relationship of each table. Clients can make requests by typing specific SQL statements on MySQL. The server application will respond with the requested information and it will appear on the clients' side.

What is difference between SQL and MySQL?

SQL is a query programming language that manages RDBMS. MySQL is a relational database management system that uses SQL. SQL is primarily used to query and operate database systems. MySQL allows you to handle, store, modify and delete data and store data in an organized way.

Is MySQL DBMS or database?

MySQL is a database management system. To add, access, and process data stored in a computer database, you need a database management system such as MySQL Server.

Is MySQL a programming language?

Finally, it's an overview of MySQL and it is not a programming language rather it is software used for the database management system.


Video Answer


1 Answers

Your server probably has ONLY_FULL_GROUP_BY turned on. You can either turn it off or add each of your selected fields to the group by.

like image 160
row1 Avatar answered Oct 20 '22 20:10

row1