Today, the MYSQ version of the site was updated to the latest version of 5.7 An error statement occurred while querying the statement:
ORDER by clause isn't in GROUP by clause and contains nonaggregated column ' G2yx_yy.u.login_time ' which are not functional Ly dependent on columns in GROUP by clause; This was incompatible with sql_mode=only_full_group_by
The error in this statement is that the order BY statement does not depend on the group by statement. The following is the error statement I wrote earlier
$myGameData = Db::name (' user_played ')
->alias (' u ')
->join (' Game g ', ' g.id = u.game_id ')
->join (' Area A ', ' a.id = u.area_id and a.game_id = u.game_id ')
->field ($condition [' field '])
->where ($condition [' where '])
->group (' u.area_id ')
->order (' U.login_time DESC ')
->select ();
The above also said why the error after the SQL statement into
$myGameData = Db::name (' user_played ')
->alias (' u ')
->join (' Game g ', ' g.id = u.game_id ')
->join (' Area A ', ' a.id = u.area_id and a.game_id = u.game_id ')
->field ($condition [' field '])
->where ($condition [' where '])
->group (' U.area_id,u.login_time ')
->order (' U.login_time DESC ')
->select ();
You'll be able to solve the problem.
MySQL ORDER by and GROUP by