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

Answers were Sorted based on User's Feedback



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

Answer / kanika

this will also work

select count(distinct columnname) from table

Is This Answer Correct ?    18 Yes 1 No

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

Answer / name

select count(distinct columnname) from table ,this is correct as i checked the query

Is This Answer Correct ?    13 Yes 1 No

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

Answer / anusha

SELECT COUNT(*)FROM(SELECT DISTINCT columnname FROM
tblname)

Is This Answer Correct ?    7 Yes 5 No

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

Answer / pradyumna

select distinct colname,count(colname) from tbl group by
colname

Is This Answer Correct ?    2 Yes 0 No

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

Answer / madhavi.bandreddi

select count(*) from (select distinct * from tablename)as
dummytable

Is This Answer Correct ?    3 Yes 2 No

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

Answer / gouri

SELECT count(*) FROM
(SELECT distinct ngcode FROM donation )d

Is This Answer Correct ?    4 Yes 4 No

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

Answer / anilreddy

select count(distinct(columnname)) from tablename

Is This Answer Correct ?    0 Yes 0 No

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

Answer / soumya

select distinct (columnname) from tablename

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL Server Interview Questions

Do you know what is a trace frag? Where do we use it?

0 Answers  


How to connect of datebase with sql express.?

0 Answers   MCN Solutions,


How can you list all the table constraints in a database?

0 Answers  


What do u mean by orphan users, how will u list them in the DB

2 Answers   IBM,


What is RAID? What are the different types of RAID configurations?

0 Answers   Flextronics,






Where to find ntwdblib.dll version 2000.80.194.0?

0 Answers  


In what sequence sql statement is processed?

0 Answers  


can we call stored Procedure in Function in Sql Server 2000 and vice versa.

3 Answers   C3I, eSoft, iPRO Solutions, Wipro,


What is the difference between value type and reference type?

0 Answers  


how to invoke a trigger on demand? : Sql server database administration

0 Answers  


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

0 Answers   Tech Mahindra,


Explain the microsoft sql server delete command?

0 Answers  


Categories