首页 > 数据库技术 > 详细

mysql查询各种类型的前N条记录

时间:2015-08-21 18:55:17      阅读:281      评论:0      收藏:0      [点我收藏+]


mysql查询各种类型的前N条记录,将3改为N(需查询条数)即可  
(select * from event_info where event_type = 1  limit 3)
union all
(select * from event_info where event_type = 2  limit 3)
union all
(select * from event_info where event_type = 3  limit 3)


 

 

原文出处:http://my.oschina.net/u/1032146/blog/149300

mysql查询各种类型的前N条记录

原文:http://www.cnblogs.com/shijiaoyun/p/4748628.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!