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 data type of time?
Explain the phases a transaction has to undergo?
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
How do I start and stop sql server?
Explain primary key in sql server?
Can you explain different types of joins?
What will be the maximum number of index per table?
What is rank function?
What are the properties and different types of sub-queries?
What are the different types of replication are there in sql server 2000?
What is faster join or union?
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas
Does a full backup include transaction log?
How to trouble shoot if unable to connect SQL Server
What is cte (common table expression)?