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 the temp table?
What is the difference between a function and a stored procedure?
Determine when an index is appropriate?
What is data modification?
How to generate create view script on an existing view?
how to rename the table
How network traffic be reduced by using the stored procedure?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What is a trigger and its types?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
what is the Enterprise manager(2000) and management studio (2005)?
What is user-defined functions? What are the types of user-defined functions that can be created?
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)