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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:31:28+00:00 2026-06-06T02:31:28+00:00

Why wouldn’t MySQL have this feature? INSERT INTO abc (a) VALUES (‘bla’) ON DUPLICATE

  • 0

Why wouldn’t MySQL have this feature?

INSERT INTO abc (a) VALUES ('bla')
ON DUPLICATE KEY
 INSERT INTO ...

Do I need a stored procedure 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-06T02:31:29+00:00Added an answer on June 6, 2026 at 2:31 am

    Insert into where exactly? The same table? You already know that’s impossible because the primary key already exists.

    If you’re talking about inserting the row into a different table, that’s another thing altogether, not to be done with a single insert statement. That’s because the general idea of the insert statement is to get a specific row into a specific table. That can usually be done with “instead-of”-type triggers.

    That idea also means that you probably shouldn’t try to use a single insert statement to insert a different row (such as changing the primary key) in the case where the original already exists. In that case, the primary key is almost certainly an artificial one in which case an auto-increment key would probably be the way to go.

    The idea behind the insert ... on duplicate key update is get that row in whether it exists already or not. It does get a specific row into a specific table.

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

Sidebar

Related Questions

I have a problem: (I wouldn't be here otherwise ;) I am creating an
I assume because the CLR this wouldn't be an issue?
I wouldn't be suprised if this turned out to be a BIDS function rather
I wouldn't ask if i wasn't sure that i have 100% no idea why
Wouldn't it be better to have a method in the viewmodel that returns the
I wouldn't ask if I couldn't find it anywhere else, but I've run into
I normally wouldn't do this, but the project I'm currently working on requires a
anyone knows why UIViewController wouldn't become first responder when I run this code: [self
I know it wouldn't be exactly equivalent to $this, but is there a way
This is a relatively open ended question so I wouldn't just mind being pointed

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.