Answer the question
In order to leave comments, you need to log in
Misunderstandings with sql_mode=ONLY_FULL_GROUP_BY
The muscle has an ONLY_FULL_GROUP_BY mode, which forces the server to understand only those queries with GROUP BY, in which all non-aggregating fields specified in SELECT according to the SQL standard are specified for grouping. And okay, when I have a query for a link of tables, where I can place the names of the columns with a functional dependence on the keys in GROUP BY. Put GROUP BY 1,2,3,4,5,6..X there and forgot. And what to do with queries where I have to group by the field of just one table?
So there is a `dates` table, bye.
id name date
1 Жанна Фриске 2013-12-12
2 Жанна Фриске 2013-12-13
3 Вера Брежнева 2013-12-14
SET @@sql_mode = "";
SELECT * FROM dates GROUP BY name;
SET @@sql_mode = "ONLY_FULL_GROUP_BY";
SELECT * FROM dates GROUP BY name;
id name date
1 Жанна Фриске 2013-12-12
3 Вера Брежнева 2013-12-14
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question