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
How many triggers you can have on a table?
What are the three different part of rdl file explain them?
What is 'write-ahead log' in sql server 2000 ?
What is the data type of time?
What are window functions in sql server?
What is the purpose of optimization?
Do you know what is a linked server in sql server?
What is named query? : sql server analysis services, ssas
what happens on checkpoint? : Sql server database administration
Can a table have 2 primary keys?
what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
What are unicode character string data types in ms sql server?
Tell me what is the stuff and how does it differ from the replace function?
What are the 7 disadvantages to a manual system?
Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .