What is the difference between the following two sql
statements
select count(*) from <tablename>
select count(col_name) from <tablename>
Answer Posted / debasis
select count(*) from <tablename> returns the number of rows
in the table.
select count(col_name) from <tablename> return number
values in the column (Ignores null value in the colum). For
example if we execute the following 2 queries then
select count(*) form emp
select count(comm) form emp
The result will be
14
4
| Is This Answer Correct ? | 34 Yes | 7 No |
Post New Answer View All Answers
Create and insert into temp table in sql server?
What are diverse clauses that form a part of sql?
What is right outer join in sql server joins?
How to find the login name linked to a given user name?
What is the report model project?
What new changes are being made in SQL Server?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
How to handle error or exception in sql?
Can two tables have the same primary key?
What programming language would you use to create embedded functions in ssrs?
What are the kinds of subquery?
What are four major operators that can be used to combine conditions on a where clause?
What are distributed partitioned views?
How to check if stored procedure is running in sql server?
What does indexation mean?