select count(1) from table where columnname=value

写成

select count(case when columnname=value than 1 else null) from table  快些