Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 257669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:06:59+00:00 2026-05-11T22:06:59+00:00

I have a table in my database which has duplicate records that I want

  • 0

I have a table in my database which has duplicate records that I want to delete. I don’t want to create a new table with distinct entries for this. What I want is to delete duplicate entries from the existing table without the creation of any new table. Is there any way to do this?

 id           action
 L1_name      L1_data
 L2_name      L2_data
 L3_name      L3_data   
 L4_name      L4_data
 L5_name      L5_data
 L6_name      L6_data
 L7_name      L7_data
 L8_name      L8_data
 L9_name      L9_data
 L10_name     L10_data
 L11_name     L11_data
 L12_name     L12_data
 L13_name     L13_data 
 L14_name     L14_data
 L15_name     L15_data

see these all are my fields :
id is unique for every row.
L11_data is unique for respective action field.
L11_data is having company names while action is having name of the industries.

So in my data I’m having duplicate name of the companies in L11_data for their respective industries.

What I want is to have is unique name and other data of the companies in the particular industry stored in action. I hope I have stated my problem in a way that you people can understand it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:07:00+00:00Added an answer on May 11, 2026 at 10:07 pm

    Yes, assuming you have a unique ID field, you can delete all records that are the same except for the ID, but don’t have “the minimum ID” for their group of values.

    Example query:

    DELETE FROM Table
    WHERE ID NOT IN
    (
    SELECT MIN(ID)
    FROM Table
    GROUP BY Field1, Field2, Field3, ...
    )
    

    Notes:

    • I freely chose “Table” and “ID” as representative names
    • The list of fields (“Field1, Field2, …”) should include all fields except for the ID
    • This may be a slow query depending on the number of fields and rows, however I expect it would be okay compared to alternatives

    EDIT: In case you don’t have a unique index, my recommendation is to simply add an auto-incremental unique index. Mainly because it’s good design, but also because it will allow you to run the query above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 263k
  • Answers 263k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I asked a similar question, but where possible I try… May 13, 2026 at 12:07 pm
  • Editorial Team
    Editorial Team added an answer Have a look at the file function. It takes care… May 13, 2026 at 12:07 pm
  • Editorial Team
    Editorial Team added an answer SunMSCAPI is only available in Java 6 as of today. May 13, 2026 at 12:07 pm

Related Questions

Over the last few weeks I have been studying the MVC design pattern for
Each product in my database can have at least three and sometimes four or
I may have either misunderstood how to use the ON DUPLICATE KEY syntax, alternatively
How does the Authorize Tag determine if the user is authorized or not? Like

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.