MySQL 5.7与5.6 group by的不同之处

在MySQL 5.7版本中注意group的用法:

use emp;

set sql_mode='';

select x.salary,x.department_id from

(select e.* from emp e order by department_id,salary desc) x group by x.department_id;

MySQL 5.7与5.6 group by的不同之处

相关推荐