mysql group by用法

mysql 查询数据库如果需要进行分组

低版本mysql数据库

select id,name ,sex,age user group by sex

高版本如上操作会有语法错误,以8.0为例,需要把查询的属性全部都添加到group by 后面

select id,name ,sex,age user group by sex,id,name,age

猜你喜欢

转载自blog.csdn.net/lxctxx/article/details/123682395