What is the difference between the following two sql
statements
select count(*) from <tablename>
select count(col_name) from <tablename>
Answer Posted / sql2000
There seem to be a problem with the solutions provided by
the above.
Both the counts should provide the same result which is the
no of rows in the table.
count (*) will result in a bigger table scan than count
(col_name) hence its advisable to use count(1) while
calculating the count for a table.
Correct me if I am wrong...:)
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is the difference between char and varchar2 datatype in sql?
What is subreport?
If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security
How to join two tables in a single query in ms sql server?
What is transaction server implicit?
How many types of stored procedures are there in sql server?
What are rows and columns?
What is the use of attributehierarchyvisible ? : sql server analysis services, ssas
What is log ldf?
What is the difference between truncate and delete commands?
What are the steps to follow to configure SQL*Net?
How to create user messages with print statements in ms sql server?
Which sql server is best?
Explain the truncate command? : SQL Server Architecture
Issues related in upgrading SQL Server 2000 to 2005 / 2008