Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between cube operator and rollup operator? : SQL Server Architecture

1125


What is efficiency data?

952


How to link tables in sql server?

936


What is cursor in ms sql server?

1150


Can two different columns be merged into single column? Show practically?

1066


How to select some specific rows from a table in ms sql server?

1008


What happens if ntwdblib.dll is missing on your machine?

1144


What extended events?

1006


In what three ways is the return statement used in a stored procedure?

1008


Can sql server 2016 run on windows 7?

917


How is SQL Azure different than SQL server?

225


Can we join two tables without primary key?

1054


How to declare and use cursor variables?

1172


How to stop a loop early with break statements in ms sql server?

1020


Explain what is meant by replication of database?

1033