sql query to find the duplicate records -
what sql query find duplicate records , display in descending, based on highest count , id display records.
for example:
getting count can done
select title, count(title) cnt kmovies group title order cnt desc
and result
title cnt ravi 10 prabhu 9 srinu 6
now query result below:
ravi ravi ravi ...10 times prabhu prabhu..9 times srinu srinu...6 times
if rdbms supports on clause...
select title ( select title, count(*) on (partition title) cnt kmovies ) t order cnt desc
Comments
Post a Comment