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
How many replicas are maintained for each sql azure db?
how can you check the level of fragmentation on a table? : Sql server administration
How to enter comments in transact-sql statements?
Explain transaction server implicit?
What is BCP? When does it used in sql server 2012?
What do you understand by a view?
What is difference between inner join and full join?
What is the function of inner join?
What are character string data types in ms sql server?
How do I edit a stored procedure in sql server?
How to convert a unicode strings to non-unicode strings?
What is the maximum number of index per table?
If no size is defined while creating the database, what size will the database have?
Define left outer join in sql server joins?
How to get the definition of a view out of the sql server?