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 |
Explain partitioned view?
What is filestream?
How to generate the Reports for the Database? I need an Example for it.Will we manually do this or else any script is there? Please let me know ASAP...
How do you create a data source?
What are the common performance issues in sql server?
How to create a view with data from multiple tables?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
Can we use where clause with group by?
How to create a new login name in ms sql server?
explain different types of constraints? : Sql server database administration
How to use go command in "sqlcmd"?
OPTIMIZATION OF SP,CURSOR,TRIGGERS
Oracle (3259)
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)