mysql分类统计cash when then
来源:互联网 发布:淘宝怎么盗图不被投诉 编辑:程序博客网 时间:2024/06/11 07:49
SELECT name as '小区名称', sum(case when location='inner' then 1 else 0 end) AS '小区内', sum(case when location='door' then 1 else 0 end) AS '小区门口', sum(case when location='street' then 1 else 0 end) AS '街道旁', round(sum(case when location='inner' then 1 else 0 end)/(SELECT count(*) FROM v_shop_community)*100,1) AS '小区内%', round(sum(case when location='door' then 1 else 0 end)/(SELECT count(*) FROM v_shop_community)*100,1) AS '小区门口%', round(sum(case when location='street' then 1 else 0 end)/(SELECT count(*) FROM v_shop_community)*100,1) AS '街道旁%'from v_shop_community group by name;
阅读全文
0 0
- mysql分类统计cash when then
- mysql when then 用法
- MYSQL--case...when...then
- MySQL CASE WHEN THEN
- MYSQL数据库:case when then
- mysql中case when then 的使用
- mysql case when then end使用方式
- MySQL数据库:case when then else end
- Mysql-----case when then else end
- mysql case when then else end 用法
- MySQL函数之CASE WHEN THEN
- MySQL case when then else end 用法
- MySQL case when then else end 用法
- mysql中case when then 语句
- mysql case when then else 用法
- Mysql (Case when then end )函数
- MySQL case when then else end 用法
- sql分组按条件统计count case when then
- Spark算子(九)
- leetcode 541. Reverse String II
- OpenResty--搭建简单的CC防护
- ActiveMQ在Win7的搭建与使用
- Android PullToRefresh 分析之扩展RecyclerView
- mysql分类统计cash when then
- 根据工作日历推算工作日的算法
- Java —— EJB 到底是什么
- POJ 2186 Popular Cows 【Tarjan+缩点】
- smarty 优缺点
- easyui tabs 真正刷新用法
- package.json详解
- linux网络编程和快速理解epoll
- Ubuntu更改服务源