首页 > 其他 > 详细

having count group by

时间:2015-08-17 16:53:40      阅读:68      评论:0      收藏:0      [点我收藏+]

select count(*) from (select field2,count(field2) from bsgj.table1  group by field,items_id having(count(field2)>1)) as tmp

where field2=4

 

 

3月份以来下单超过两单的收货人手机号
 
SELECT t1.ship_mobile FROM orders as t1  
where from_unixtime(t1.createtime)>‘2015-03-01 00:00:00‘ 
and t1.pay_status in (‘1‘,‘4‘,‘5‘)
group by t1.member_id having(count(t1.member_id)>2) order by t1.order_id desc

having count group by

原文:http://www.cnblogs.com/walter371/p/4736998.html

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