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 disadvantage of SQL Loder?
How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?
what's the difference between SQL & MY-SQl...? And what we learn from these ....?
How do I find the size of a sql server database?
Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?
Does sql server 2016 have ssms?
What is partition index in sql server?
What all db objects can be found in MSDB database of a SQL Server instance?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
Do you know what is sql service broker?
What is difference statement and preparedstatement?
How efficient you are in oracle and SQL server?