Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Hai Friends

Author  Topic 

Pandiya-Quads
Starting Member

1 Post

Posted - 2009-01-22 : 09:29:35
I am new to Sql team... Is there any difference in execution of the following Queries

Select Count(*) from Tablename

Select Count(Distinct Fieldname) from Tablename

Pandiya

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-22 : 09:32:41
yup
first one returns number of records in table
second one returns count of distinct values in fieldname column of table
Go to Top of Page
   

- Advertisement -