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 6110587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:31:58+00:00 2026-05-23T14:31:58+00:00

I have a table that I need a MYSQL Select statement so I can

  • 0

I have a table that I need a MYSQL Select statement so I can find the corrupt data and manually fix it.

Sample table

TABLE_A
id | type | value1 | value2
 1 |  10  | 123    | 987  
 2 |  10  | 123    | 987
 3 |  10  | 123    | 789
 4 |  20  | 123    | 987
 5 |  20  | 456    | 987
 6 |  30  | 123    | null
 7 |  30  | 123    | null
 8 |  40  | 123    | 987

I need a select statement that will list records that if they have the same “type” and value1 is not the same and/or value2 not the same.

For Example

  • ID 1,2,3 – will be displayed because value2 is different in id 3 and they have the same “type”

  • ID 4,5 will be displayed because value1 is different and they have the same “type”

  • ID 6,7 will NOT be displayed because value1 and value2 are the same for the same “type”

  • ID 8 will NOT be displayed because there is only one with this type.

I have been trying to get my head around this for days and need some help. Thanks

  • 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-23T14:31:59+00:00Added an answer on May 23, 2026 at 2:31 pm
    SELECT a.id as problem_id
    FROM TABLE_A as a JOIN TABLE_A as b
    ON a.type = b.type
    WHERE a.value1 <> b.value1 OR a.value2 <> b.value2
    GROUP BY problem_id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a select from table which does not have column that tells when
I have a table that contains maybe 10k to 100k rows and I need
I have a table that got into the db_owner schema, and I need it
I have an SQLite table that contains a BLOB I need to do a
I have a Word document that starts with a Table of Contents. I need
I have a table that has redundant data and I'm trying to identify all
I have a few huge tables on a production SQL 2005 DB that need
I have a couple of tables in a SQL 2008 server that I need
I have a table that contains tasks and I want to give these an
I have a table that records a sequence of actions with a field that

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.