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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:24:28+00:00 2026-06-14T20:24:28+00:00

Example of my table: Table_1 +—–id—–+—–zone—–+—–address—–+—–status—–+ =============+==============+=================+================+ 1 5 10 ok 2 2 8

  • 0

Example of my table:

Table_1

+-----id-----+-----zone-----+-----address-----+-----status-----+
=============+==============+=================+================+
     1              5                10               ok
     2              2                 8               ok
     3              3                 2               ok  
     4              2                 5               ok
     5              3                 2               ok 
     6              5                10               ok     
     7              3                 2               ok    

I need to check the duplicate entries [zone/address combination] and have the table like this:

Table_1

+-----id-----+-----zone-----+-----address-----+-----status-----+
=============+==============+=================+================+
     1              5                10               ok
     2              2                 8               ok
     3              3                 2               ok  
     4              2                 5               ok
     5              3                 2               duplicate 
     6              5                10               duplicate 
     7              3                 2               duplicate 

The query should check the duplicate combination of zone, address and should update the ‘status’ column.
I need to keep the first duplicate data status unchanged and the rest of the repeated data should be marked as ‘duplicate’?

Any ideas on how to do this?

  • 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-14T20:24:29+00:00Added an answer on June 14, 2026 at 8:24 pm

    You could use this:

    update
      Table_1 t1 inner join Table_1 t2
      on t1.zone=t2.zone
         and t1.address=t2.address
         and t1.id>t2.id
    set t1.status='duplicate'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example I have a table MyTable like this: Id Value Rate 1 10
If I have two tables, like this for example: Table 1 (products) id name
I have the following example in a SQL table Cust Group Sales A 1
I have two tables, for example: Table A Table B ======= ======= Name |
I have three tables that I need to join together and get a combination
Need your help on the below. I have a table where I have functions
I have a count table, and i would like to be able to sum
I would like to insert in a table some pieces of code. For example:
i am looking for the query, deletes the all duplicate values. Example Table: 1
I have a table for 'Parts': ID (PK) name detail so an example Parts

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.