Process repeated table records (query and delete)

Source: Internet
Author: User
Process repeated records (query and delete) in a table. 1. Repeat records with the same Name are retained. Only one record with the same Name is retained, keep one of the records large or small. 1. Used to query repeat processing records (if the column has no size relationship, SQL2000 uses the auto-incrementing column and temporary table for processing, and SQL2005 uses the row_number function for processing ).

Process repeated records (query and delete) in a table. 1. Repeat records with the same Name are retained. Only one record with the same Name is retained, keep one of the records large or small. 1. Used to query repeat processing records (if the column has no size relationship, SQL2000 uses the auto-incrementing column and temporary table for processing, and SQL2005 uses the row_number function for processing ).

Process repeated table records (query and delete)

Query
1. record with the same Name duplicate value. Only one record is retained if there is no size relationship.
2. if the Name is the same and the ID has a size relationship, keep one of the records large or small.

I. Used to query repeat processing records (if the column does not have a size relationship, SQL2000 uses the auto-incrementing column and temporary table for processing, and SQL2005 uses the row_number function for processing)

Generate Test Data

() # T 5 (, (1), (2) 9) 10 INSERT # T, N, n, N, Hong Kong Space, Hong Kong virtual host, Hong Kong Space

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.