mysql多条count且类型多个SQL语句查询@TOC
mysql多条count且类型多个SQL语句查询
– 查询交易总条数
select sum(case when 字段 =‘100002’ then 1 else 0 end) as 查询展示名称, – 100002 交易类型码值
sum(case when 字段 =‘100001’ then 1 else 0 end) as 查询展示名称, – 100001 交易类型码值
from 表名b
mysql多条count且类型多个SQL语句查询@TOC
– 查询交易总条数
select sum(case when 字段 =‘100002’ then 1 else 0 end) as 查询展示名称, – 100002 交易类型码值
sum(case when 字段 =‘100001’ then 1 else 0 end) as 查询展示名称, – 100001 交易类型码值
from 表名b