------------------------------ col1 | col2 | col3 ------------------------------ 1 | null | test 2 | 1w | test1 null | null | test3
---------------------- columnname | count ----------------- col1 | 2 col2 | 1 col3 | 3 ------------------
select a.name ,(select count(a.name) from users b where a.name is not null) from syscolumns a where id=(select id from sysobjects where name='users') group by a.name
col1 |3 col2 |3 col3 |3
SELECT COUNT(COL1) AS COL1 ,COUNT(COL2) AS COL2 ,COUNT(COL3) AS COL3 FROM USER
Count
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)