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
What are the disadvantages of using the stored procedures?
What do you mean by collation recursive stored procedure?
How do we synchronize On-Premise SQL server with SQL Azure?
How to get the definition of a user defined function back?
What are the differences between stored procedure and the dynamic sql?
Distinguish between nested subquery and correlated subquery?
How can you start sql server in different modes?
What is importing utility?
How to drop an existing stored procedure in ms sql server?
What is normalization? Describe its different types.
How can I check if a view exists in a sql server database?
What is subquery? Explain the properties of a subquery?
How to create a large table with random data for index testing in ms sql server?
Which tools are available to manage SQL Azure databases and servers?
Why use “nolock” in sql server?