FBLMG
8/29/2018 - 2:05 AM

MYSQL 统计查询总结

MYSQL 统计查询总结

1、查询多条件统计结果
select
sum(
if((sex = 1 and age = 2),1,0)
),
sum(
if((sex = 1 and age = 5),1,0)
),
sum(
if((sex = 1 and age = 10),1,0)
)
from a_test