mysql group by 组内排序

时间:2017-08-31 15:38:42   收藏:0   阅读:328

http://blog.csdn.net/shellching/article/details/8292338

 

所有SSD配置的最近生效费率查询


select * from billing_rates_tbl as tt
where
sub_res_id like "%ssd::%"
and res_type="server"
and unit="M"
and duration = "12"
group by sub_res_id, effective_date having
effective_date=(select max(effective_date) from billing.billing_rates_tbl where sub_res_id=tt.sub_res_id)

原文:http://www.cnblogs.com/peterpanzsy/p/7458213.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!