sql - How to delete duplicate rows in Oracle -


i need duplicate rows. have deleted duplicate rows 1 table using following method

delete names rowid > (select min(rowid) names b b.name=a.name , b.age=a.age ); 

it did work particular table did same thing table has duplicate reference numbers each doctor different unique codes.

doc_name  ref_no  unique_code ------------------------------ abcd      1010     1111 abcd      1010     1112 cdef      1011     1113 cdef      1011     1114 

my result should this:

doc_name ref_no unique_code --------------------------- abcd     1010      1111 cdef     1011      1113 

did try ?

delete names rowid > (select min(rowid) names b b.doc_name=a.doc_name , b.ref_no=a.ref_no ) 

try also

select *   doc_unique  (div_cd, doc_name, b_dt, ft_nm, unq_cd, desg_cd,  spec_cd) in (select div_cd, doc_name, b_dt, ft_nm, unq_cd, desg_cd,  spec_cd                              doc_unique                             group div_cd, doc_name, b_dt, ft_nm, unq_cd, desg_cd,  spec_cd having count(*) > 1) 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -