ORACLE-004-read duplicate data in a column, oracle-004-read

Source: Internet
Author: User

ORACLE-004-read duplicate data in a column, oracle-004-read

SELECT primary key or columns that can represent the current row FROM (SELECT primary key or columns that can represent the current row, repeated columns, row_number () OVER (partition by repeated column order by repeated column DESC) rn from tableName) where rn = 1 is read as unique and duplicates are removed through RN = 1.


The reading result is unique, and the repetition is removed through RN = 1.


Oracle query results if a field is repeated, the data with the smallest value of the other field is obtained.

Select rownum, a. * from select (name, max (results) from table_a group by name order by name);

In SQL and Oracle, how does one delete data rows with duplicate values in a column in a table? Retained a duplicate data row

SQLServer
Delete tabel from tabel a where exists (select * from tabel where id <a. id and name = a. name and age = a. age and address = a. address)
Oracle
Delete from tabel a where exists (select * from tabel where id <a. id and name = a. name and age = a. age and address = a. address)

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.