How to get the count of distinct records. Please give me the
query?

Answer Posted / kanika

this will also work

select count(distinct columnname) from table

Is This Answer Correct ?    18 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between for auto and for nested?

516


Do you know spatial data types - geometry and geography in sql server 2008?

585


Do you have any idea about the tcl commands?

556


What are the properties and different types of sub-queries?

568


How to insert multiple rows with a subquery?

532






Define Unique Key?

596


How raid can influence database performance?

579


Mention the 3 ways to get a count of the number of records in a table.

555


What are the joins in sql server? : sql server database administration

538


What happens if the update subquery returns multiple rows in ms sql server?

593


What is dirty read?

631


how can you attach more than 20 ldf files in sql server

1575


How do I install only the client tools of sql server 2000?

555


What are cursors and when they are useful?

577


what is a deadlock? : Sql server database administration

503