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 are the types of subscriptions in SQL Server replication?

1020


What is table valued function and scalar valued functions?

1069


How to create new tables with "select ... Into" statements in ms sql server?

979


What happens if an integer is too big for int date type?

963


What are the types of stored procedures in an sql server?

979


Why use “pivot” in sql server?

1101


What is surrogate key? : sql server analysis services, ssas

1100


What Are the Main Features of SQL Azure?

117


What is the stuff and how does it differ from the replace function?

1111


What are the different types of normalization?

1153


What does it mean to invest in the index?

954


When multiple after triggers are attached to sql table, how to control the order of execution?

1037


What are 3 ways to get a count of the number of records in a table?

1066


Which are the two editions in which SQL Azure database available?

119


What is a primary key?

948