您的位置:首页 > 数据库 > MySQL

mysql order by内排序

2016-04-20 15:35 337 查看
目前还没找到完美的解决方案
https://dev.mysql.com/doc/refman/5.6/en/example-maximum-column-group-row.html http://stackoverflow.com/questions/1066453/mysql-group-by-and-order-by https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
这个貌似解决了,还得再理解一下。。。
http://www.educity.cn/wenda/404337.html
--三、按name分组取第一次出现的行所在的数据。

select a.*from tb a where val = (selecttop1 val from tb where name = a.name) orderby a.name
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: