查询多个count展示结果
2024-10-19 13:45:59
<select id="getCountByDISC" resultType="com.rm.algo.entity.AlgoResult">
SELECT
sum( case when t2.type='D' and content='0' then 1 else 0 end) as unlikeD,
sum( case when t2.type='I' and content='0' then 1 else 0 end) as unlikeI,
sum( case when t2.type='S' and content='0' then 1 else 0 end) as unlikeS,
sum( case when t2.type='C' and content='0' then 1 else 0 end) as unlikeC,
sum( case when t2.type='D' and content='1' then 1 else 0 end) as likenessD,
sum( case when t2.type='I' and content='1' then 1 else 0 end) as likenessI,
sum( case when t2.type='S' and content='1' then 1 else 0 end) as likenessS,
sum( case when t2.type='C' and content='1' then 1 else 0 end) as likenessC
FROM cust_record_data t1 left JOIN cust_qn_option t2 ON t1.option_id=t2.id WHERE
t1.validate_flag="Y" AND t2.validate_flag="Y" AND t1.qn_id=#{param1} AND t1.`status`=1
</select>
最新文章
- Android 短信监听及用途分析
- iis设置asp站点
- 【原创】关于不同分支代码的Merge有了透彻的理解
- Shiro-认证
- SVN提交碰到的问题奇怪的问题
- js javascript jquery区别和联系
- 在ASP.NET开始执行HTTP请求的处理程序之前
- Winform 隐藏程序窗口
- Linux命令: ln
- GDB: basics
- stm32通过电调带动电机(可按键调速)
- 一个CSS简单入门网站
- python入门day01
- python简单入门
- SQLServer图数据库一些优点
- 2019_01_16 sem_init
- C# 操作文件类,文件夹存在判断,创建,文件内容读写。
- grid - 网格项目层级
- hive SQL 行转列 和 列转行
- 小程序组件 scroll-view 滑动