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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:09:30+00:00 2026-06-01T00:09:30+00:00

I have table with following structure and test records: +——–+——–+———+ | vid | number

  • 0

I have table with following structure and test records:

+--------+--------+---------+
| vid    | number | name    |
+--------+--------+---------+
| 2      | 012345 | name1   | r1
| 6      | 0012345| 1name   | r2
| 5      | 012345 | namee   | r3
| 6      | 9111522| name6   | r4
| 3      | 999999 | name65  | r5
| 2      | 0999999| name64  | r6
+--------+--------+---------+

The rows r1, r2 and r3 are duplicated, because 12345 is inside in the field number and r5 and r6 are duplicated.
I want to show duplicate rows from this table.

What query I must to create to get this result?

Thanks in advance !

  • 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-01T00:09:32+00:00Added an answer on June 1, 2026 at 12:09 am

    It looks like you’re storing your “number” column as a string (VARCHAR). If that is the case I’d highly recommend you switch it to an INT column type. If that’s not possible then I’d make sure your app normalises the data on the way in so the string-formatted numbers are always in the same format. It will make life much easier.

    Anyway in terms of the data that’s there, assuming that a duplicate means “the numeric representations of the data are the same” then this would work

    SELECT
      t1.vid, t1.number, t1.name
    FROM table t1
      INNER JOIN table t2
      ON CAST(t1.number AS SIGNED)=CAST(t2.number AS SIGNED) AND t1.vid!=t2.vid
    GROUP BY t1.vid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table emp with following structure and data: name dept salary -----
i have table with following structure, name (type: TEXT) price (type: INT) color (type:
I have following table structure: CREATE TABLE pilot_groups ( id INT PK, name VARCHAR(50),
I have following table structure ID Name Parent_ID 1 abc 0 2 efg 1
I have a table with the following structure - Category {Id, Name, ParentId} I
I have a table discussion of which structure is following: Table name: discussion, Id
I have already googled for this I have a Table with following structure in
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have a table with the following structure id(int) | col1(int) | col2(int) |
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL

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.