登录 注册

mysql同时使用group by和order by

收藏
[Mysql] 标签: 2012-09-09 17:57
原始代码 全屏查看 0评 / 0藏 / 4670阅  跳至 / 3行
1
2
3
-- 子查询解决方案
select * from (select id,name from `test` order by `date` desc) as `temp`  
  group by category_id order by `date` desc;

最新评论

  · · · · · ·  (共0条)

目前还没有评论

登录后您才可以发表评论。 马上登录 立即注册
cottage
2012-02-29加入
一段精湛的代码,天涯何处寻知音!
Back to Top