select count(*) from tablename where b='广州' and not(a is nulll)

解决方案 »

  1.   

    select count(*) from tablename where b='广州' and a is not null and a<>''
      

  2.   

    select count(*) from table where b='广州'
      

  3.   

    select count(a) from table where b='广州'
      

  4.   

    select count(a) from table where b='广州' and a<>''
      

  5.   

    COUNT(*) 返回组中项目的数量,这些项目包括 NULL 值和副本。COUNT(ALL expression) 对组中的每一行都计算 expression 并返回非空值的数量。COUNT(DISTINCT expression) 对组中的每一行都计算 expression 并返回唯一非空值的数量