What is the Query to print out the individual total number of
duplicate row in sql.
Answer Posted / girija.112
ANS:
SELECT department_id,COUNT(department_id) AS "Occurrences"
FROM departments
GROUP BY department_id
HAVING ( COUNT(department_id) > 1 )
DEPARTMENT_ID Occurrences
------------- -----------
80 2
60 3
--In my 'departments' table , i have not assigned department_id column as a "primary key / unique key"
| Is This Answer Correct ? | 28 Yes | 3 No |
Post New Answer View All Answers
What does over partition by mean in sql?
What is primary key in db?
What are system versioned tables?
How do I trace sql profiler?
Is sql scripting language?
How do you update a value in sql?
how to concatenate two character strings? : Sql dba
how can we submit a form without a submit button? : Sql dba
What is a scalar value in sql?
Is sqlite good enough for production?
What is left join in postgresql?
Is sql a backend language?
how to check myisam tables for errors? : Sql dba
What is the difference between functions, procedures, and packages in pl/sql?
how many sql ddl commands are supported by 'mysql'? : Sql dba