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 cube operator and rollup operator? : SQL Server Architecture
What is efficiency data?
How to link tables in sql server?
What is cursor in ms sql server?
Can two different columns be merged into single column? Show practically?
How to select some specific rows from a table in ms sql server?
What happens if ntwdblib.dll is missing on your machine?
What extended events?
In what three ways is the return statement used in a stored procedure?
Can sql server 2016 run on windows 7?
How is SQL Azure different than SQL server?
Can we join two tables without primary key?
How to declare and use cursor variables?
How to stop a loop early with break statements in ms sql server?
Explain what is meant by replication of database?