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 Delete and Truncate command in SQL

1084


What does sql server mean?

974


How many triggers you can have on a table?

933


How to create a large table with random data for index testing in ms sql server?

978


What is a trigger in sql server?

1090


Describe how to use linked server?

933


Ms sql server index?

1009


What are the two authentication modes in sql server?

1058


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

931


What happens when the SQL Azure database reaches Max Size?

107


How to get nth highest salary from employee table.

1102


What is the difference between count and distinct count?

842


How to list all schemas in a database?

1004


explain declarative management framework (dmf) in sql server 2008?

949


What function does a database engine serve in the sql server?

985