| Author: Ashutosh 31 Aug 2007 | Member Level: Gold | Rating:  Points: 2 |
Hi COUNT(ColumnName)==> Returns the count of rows in a table by eliminating NULL values;
COUNT(*) ==>returns the cardinality (total number of rows) for an entire table.
The fact that COUNT(*) and COUNT(column) treat NULLs differently can be used to your advantage in many situations such as calculating the NULLRows
Hope this gives you differece. - Regards Ashutosh
|
| Author: Bindu Rajkumar 31 Aug 2007 | Member Level: Bronze | Rating:  Points: 2 |
Let b_table having one column name
the following is result of select * from b_table name ---------- raja bindu Null kumar
1.select count(*) from b_table
result is 4
2. select count(name) from b_table
result is 3
here the thing is in second query the null value is not taken. in the 1 query all rows will returns no matter which value it may contains whether null or any value
|
| Author: sriram 10 Sep 2007 | Member Level: Silver | Rating:  Points: 2 |
select count(*) from emp- it will count null values also select count(empid) from emp it wont count null values
|