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 / debasis

select count(*) from <tablename> returns the number of rows
in the table.

select count(col_name) from <tablename> return number
values in the column (Ignores null value in the colum). For
example if we execute the following 2 queries then

select count(*) form emp
select count(comm) form emp

The result will be
14
4

Is This Answer Correct ?    34 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create and insert into temp table in sql server?

1037


What are diverse clauses that form a part of sql?

1072


What is right outer join in sql server joins?

1186


How to find the login name linked to a given user name?

1013


What is the report model project?

142


What new changes are being made in SQL Server?

1195


What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas

1267


How to handle error or exception in sql?

986


Can two tables have the same primary key?

1216


What programming language would you use to create embedded functions in ssrs?

184


What are the kinds of subquery?

1010


What are four major operators that can be used to combine conditions on a where clause?

1056


What are distributed partitioned views?

1083


How to check if stored procedure is running in sql server?

1066


What does indexation mean?

982