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 |
What is an entity-relationship diagram (erd)?
What are user-defined functions (udfs) in sql server?
What's new in sql management studio for sql server? : sql server management studio
ehat is the default port no of sql 2000?
Explain SELF JOIN ?
Define outer join in sql server joins?
what is the difference between count(*) and count(1) ?
About Indexed Views? with example? plz reply...
What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.
Explain what is sql server english query?
What do you mean by tablesample?
How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?
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)