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 char and varchar2 datatype in sql?

1121


What is subreport?

144


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

1104


How to join two tables in a single query in ms sql server?

1058


What is transaction server implicit?

1064


How many types of stored procedures are there in sql server?

1057


What are rows and columns?

1064


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

1119


What is log ldf?

1044


What is the difference between truncate and delete commands?

1110


What are the steps to follow to configure SQL*Net?

1076


How to create user messages with print statements in ms sql server?

1030


Which sql server is best?

1048


Explain the truncate command? : SQL Server Architecture

1232


Issues related in upgrading SQL Server 2000 to 2005 / 2008

1940