How to get the count of distinct records. Please give me the
query?
Answers were Sorted based on User's Feedback
Answer / kanika
this will also work
select count(distinct columnname) from table
| Is This Answer Correct ? | 18 Yes | 1 No |
Answer / name
select count(distinct columnname) from table ,this is correct as i checked the query
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / anusha
SELECT COUNT(*)FROM(SELECT DISTINCT columnname FROM
tblname)
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / pradyumna
select distinct colname,count(colname) from tbl group by
colname
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / madhavi.bandreddi
select count(*) from (select distinct * from tablename)as
dummytable
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / gouri
SELECT count(*) FROM
(SELECT distinct ngcode FROM donation )d
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / anilreddy
select count(distinct(columnname)) from tablename
| Is This Answer Correct ? | 0 Yes | 0 No |
difference between Clustered index and non clustered index ?
SQL Server Performance Tuning for Stored Procedures & reducing debugging time?
1 Answers CarrizalSoft Technologies,
Difference between drill down and drill through report.
What is best institute to Learn DotNET And SQL in chennai?
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
What are the basic features of a trigger in ms sql server?
How to test subquery results with the exists operator?
Explain trigger and trigger types?
What are the different types of columns types constraints in the sql server?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
How to know the NAME of the Database and SIZE of the Database at the client node in Sql Server 2005
what is memory-optimized nonclustered indexes
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)