How do I use the count function in SQL?

Count is an aggregate function that will return number of records that meet a criteria.

So this statement will count all values of colX when the where clause condition is met. select count(colX) as total_count from table1 where colx not null and colX >0. This will return a single result of 7 from this table.