按时间排序返回前十条数据且不重复
2015-09-09 20:01
288 查看
select id,max(update_time) from table1 group by id order by date limit 10
select t.* from table1 t where update_time = (select max(update_time) from table1 where id= t.id) order by date limit 10
select t.* from table1t where not exists (select 1 from table1 where id= t.idand update_time > t.update_time) order by date limit 10
select t.* from table1 t where update_time = (select max(update_time) from table1 where id= t.id) order by date limit 10
select t.* from table1t where not exists (select 1 from table1 where id= t.idand update_time > t.update_time) order by date limit 10
相关文章推荐
- leetcode9 Palindrome Number
- 网站性能优化
- ARC,MRC理解
- 屌屌的Web树--保存分类
- 写一个网络图片查看器
- 神经网络
- Qt5 中使用了QQuickWidget,程序退出时容易崩溃的解决办法。
- lesson3 -Vim
- 引导页的铺设
- Java简单彩票系统(35选7)
- HDU-2732 Leapin's Lizards
- 使用分布式数据库集群做大数据分析之OneProxy
- button初始化类目
- lesson2 -basic Linux tasks
- 哈哈 一个小程序
- HDU 5024(枚举+搜索/记忆化搜索)
- poj 3087 Shuffle'm Up
- ORA-00904:“”:标识符无效
- 1001--Java 多线程 并发编程
- URL最大长度