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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:58:25+00:00 2026-06-06T15:58:25+00:00

The problem is: I have got a table of columns (A, B, C) where

  • 0

The problem is:

I have got a table of columns (A, B, C) where A+B accounts for a unique key. A few records shall be updated (set is on C) and some records are new, unique A+B keys do not exist in the table. The perfect is INSERT ON DUPLICATE KEY UPDATE, but… Not updated rows (within a considered value for the A column – the same A value for all updates considered) should be deleted. The question is what is the finest way to do it, preferably a shortest query/stored procedure. I found the way around but I am looking for a more specyfic solution to the purpose.

  • 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-06T15:58:26+00:00Added an answer on June 6, 2026 at 3:58 pm

    The way I do it is to have a todelete flag. Set it to 1 on all rows before updating, then during the update set updated rows to have todelete=0. Then delete any rows where todelete is still 1.

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

Sidebar

Related Questions

I've got a problem with the mysqli result set. I have a table that
I got a simple problem in SQLAlchemy. I have one model in a table,
Got a problem with a query I'm trying to write. I have a table
I need some help joining two table. I've got: my_type_table , which has columns:
I have a table with about 1000 records and 2000 columns. What I want
Got a slightly tricky problem I'd like some advice on. I have a source
I got a table with 4 columns and several rows. The problem is that
I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User
I have got a the following problem: I have got multi-step form where in
Can't understand what is a problem here: I have got main.cpp file where I

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.