当前位置: 代码迷 >> SQL >> 一段复合查询的sql话语备份 排序 group
  详细解决方案

一段复合查询的sql话语备份 排序 group

热度:304   发布时间:2016-05-05 14:08:56.0
一段复合查询的sql语句备份 排序 group
select * from brands b join (select brand_id,count(*) as product_amount from products where id in (#{product_id_array.join(',')}) group by brand_id order by count(*) desc) as bc where b.id = bc.brand_id order by bc.product_amount desc
  相关解决方案