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

  • SEARCH
  • Home
  • 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 9139315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:22:17+00:00 2026-06-17T09:22:17+00:00

Lets say I have a column named source in a table x. Individual entries

  • 0

Lets say I have a column named source in a table x. Individual entries can be like;

Id   c1   c2      source ...
1    a     b      something
2    b     a      something  
3    a     b      somethingelse
4    c     a      somethingelse
5    a     b      something
6    b     c      something

How can I delete entries with less than 3 same elements in source? For example since source value somethingelse appears 2 times, I need all entries that have somethingelse removed.

  • 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-06-17T09:22:18+00:00Added an answer on June 17, 2026 at 9:22 am
    DELETE  a
    FROM    tableName a
            INNER JOIN
            (
                SELECT  source
                FROM    tableName
                GROUP BY SOURCE
                HAVING COUNT(*) < 3
            ) b ON a.source = b.source
    
    • SQLFiddle Demo

    One more thing to do for faster performance, add an INDEX to column SOURCE.

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

Sidebar

Related Questions

I have two tables. Lets say they look like this Table Sports: Column 1:
Lets say I have a table that has a bit column named Active .
Lets say I have table named Place with columns: placeId int not null auto_increment,
Lets say I have multiple commands like 5000 which updates some column and row
Lets say I have a table in MySQL called articles, that has a column
I have a set of ids in a table (column id), lets say from
Lets say I have a table with 20 entries. They are sorted by date
lets say I have a Datetime column in DB. It has a data like
lets say i have a table named cars{ 'id','name','brand_id', } and another table brand{
lets say we have a table BNK_ACCT_GRP_ST with these columns: Column Name ID Pk

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.