码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2015-08-21 18:57:35      阅读:209      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!