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 are “phantom rows”?
Where are sql server user names and passwords stored in sql server?
You are doing log shipping due to some reasons it is failing. How you will proceed from there
explain query execution plan
How do you manipulate data?
hi i am having .mdf file and .ldf file ..how can i get the all table in my .mdf..plz give solution
what is the information that can be stored inside a bit column? : Sql server database administration
How can we delete a table in sql server?
What's new in sql management studio for sql server? : sql server management studio
What is difference beteen Migration and Upgrdation?
How can I know what query is executing by by a particural user? (using sp id or any othe way.)
what is denormalization and when would you go for it? : Sql server database administration
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)