Questions about MySQL querying multiple data

Source: Internet
Author: User
MySQL query for multiple data issues
Select multiple data how to find out what is repeated in the inside and indicate the last few days to insert the non-duplicate into the database

------Solution--------------------
If you want to clear the duplicate records inside the table, you can use INSERT into ..... SELECT ..... Statement is complete.
Create a table with the same structure as the original table, and insert all the records from the original table into the newly created table using the above statement. Create a new table, you need to create a unique composite index, so that when inserted, the same record will be automatically skipped without inserting.
The SQL statement for a unique composite index is similar to the following:
SQL Code
ALTER TABLE  ' mytable ' ADD UNIQUE (' username ', ' age ');
  • 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.