SQL Server:
select sum(case 字段1 when not null then 1 else 0 end)
+sum(case 字段2 when not null then 1 else 0 end) 
+sum(case 字段3 when not null then 1 else 0 end)
from TableName

解决方案 »

  1.   

    我用的是Delphi自带的数据库paradox
      

  2.   

    paradox是目录数据库,在tablename中将所查表的路径写全即可
      

  3.   

    贊成 zhuzhichao(竹之草) 方式大致是這樣!!!
      

  4.   

    是不都为空吗?select count(*) from tbl1 
    where 字段1 is not null or 字段2 is not null or 字段3 is not null or 字段4 is not null or 字段5 is not null or 字段6 is not null
      

  5.   

    select count(*) from tbl1 
    where (字段1 is not null) and (字段2 is not null) and (字段3 is not null) and (字段4 is not null) and (字段5 is not null) and (字段6 is not null)