mysql group by 组内排序

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)

posted @ 2017-08-31 14:43  peterpanzsy  阅读(749)  评论(0编辑  收藏  举报