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
详细解决方案
一段复合查询的sql话语备份 排序 group
热度:304 发布时间:2016-05-05 14:08:56.0
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
相关解决方案
- 大伙平时用到ATG么(Art Technology Group)
- 水晶报表,分组后 group header 和group footer同时显示(急求,谢谢)
- 因为该列没有包含在聚合函数或 GROUP BY 子句中解决方法
- 问个 group 的 select 语句,大家看看那里错了解决方法
- 急 group by 有关问题
- group by 用linq或EF如何写
- linq to entity ,GROUP BY having解决方案
- 请问SAP中 怎么使用FUNC. GROUP(函数组)
- fastdb "group by time"查询一组时间,该怎么处理
- Sql 相同列,合并行, 用distinct 和 group by吗?解决思路
- substr() 不能跟在 group by 后,求解!该怎么解决
- group by 子句的有关问题
- group by 子句无效解决方法
- Andrew W. Davis’s 2013 prediction - Cisco will exit the hardware-based group video conferencing
- channel-group 零 unframed 这句命令是什么意思
- Speak english for fun! (QQ Group, 14819059)解决办法
- 0516-1355 splitvg: Unable to split the volume group. 十分着急的异常
- group by 的有关问题!
- group by,该怎么处理
- group by跟where的用法
- 大量数据 group by 求 优化解决方法
- 问一个mysql,group by 日期分组查询的有关问题
- group by和where的用法解决方法
- GXT组件应用教程3――Column Group
- 大家平时用到ATG么(Art Technology Group),该怎么解决
- 子查询的有关问题select id,(select top 1 username from stu b where a.id=b.id) as usera from stu a group by id怎么取得其中子查询的值呢
- hibernate中,GROUP BY 之后使用方法。请高人帮忙。多谢!解答之后立即结贴
- Mybatis分组有关问题(group by)
- 求 arraylist 像sql group by 同样分组合计
- SQL GROUP BY 类似有关问题