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 Delete and Truncate command in SQL
What does sql server mean?
How many triggers you can have on a table?
How to create a large table with random data for index testing in ms sql server?
What is a trigger in sql server?
Describe how to use linked server?
Ms sql server index?
What are the two authentication modes in sql server?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
What happens when the SQL Azure database reaches Max Size?
How to get nth highest salary from employee table.
What is the difference between count and distinct count?
How to list all schemas in a database?
explain declarative management framework (dmf) in sql server 2008?
What function does a database engine serve in the sql server?