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
Explain what is public role in sql server?
Can we deploy SSRS reports on our personal website?
Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?
How to drop an existing table with "drop table" statements in ms sql server?
What are parameterized reports? What are cascading parameters in ssrs reports?
How to concatenate two strings in SQL Server.
What is shrink log file?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
What are the pre-defined functions in the sql server?
Explain the truncate command? : SQL Server Architecture
why would you use sql agent? : Sql server database administration
How many replicas are maintained for each SQL Azure database?
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
What are the different subsets of sql?
Is it possible to call a stored procedure within a stored procedure?