Oracle table fields to heavy ____oracle

Source: Internet
Author: User
The weight of the word field
View Duplicate data
SELECT * from Testrepeat t where t.id in (select ID from testrepeat GROUP by ID has count (ID) > 1);
Delete duplicate records, keep rowid the smallest rows
Delete from Testrepeat t
 where t.id in (select ID from testrepeat GROUP by ID have count (ID) > 1) and
   rowid n OT in
       (select min (rowid) from Testrepeat GROUP by ID has count (*) > 1)

Multi-field to weight
View Duplicate data
SELECT * from Testrepeat t where (T.id,t.phone) in (select Id,phone to Testrepeat GROUP by Id,phone have count (*) > 1);
Delete duplicate records, keep rowid the smallest rows
Delete from Testrepeat t
 where  (T.id,t.phone) in (select Id,phone to  testrepeat GROUP by Id,phone has COUNT (*) > 1) and
   rowID not in
       (select min (rowid) from Testrepeat GROUP by Id,phone have count (*) > 1)


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.