• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

jOOQ workaround for “cannot specify goal desk for replace in FROM clause”

Admin by Admin
April 16, 2025
Home Coding
Share on FacebookShare on Twitter


In MySQL, you can’t do that:

create desk t (i int major key, j int);
insert into t values (1, 1);

replace t
set j = (choose max(j) from t) + 1;

The UPDATE assertion will increase an error as follows:

SQL Error [1093] [HY000]: You’ll be able to’t specify goal desk ‘t’ for replace in FROM clause

Folks have thought of this to be a bug in MySQL for ages, as most different RDBMS can do that with none points, together with MySQL clones:

  • MariaDB 10.2
  • SingleStore 6 (beforehand referred to as MemSQL)

Fortunately, jOOQ can simply rework such queries for you, everytime you’re attempting to UPDATE or DELETE a goal desk, with a predicate that will depend on the goal desk itself. In these circumstances, jOOQ will simply apply the next workaround:

replace t
set j = (
  choose *
  from (
    choose max(j) from t
  ) t
) + 1;

Now, the question works with none syntactic points. Related workarounds are documented within the MySQL docs, however with jOOQ, you merely don’t have to consider this limitation.

Like this:

Like Loading…

Printed by lukaseder

I made jOOQ
View all posts by lukaseder

Tags: clausejOOQtabletargetupdateWorkaround
Admin

Admin

Next Post
It Lady Codes (April 2025)

It Lady Codes (April 2025)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

Interview with Hamza Tahir: Co-founder and CTO of ZenML

Interview with Hamza Tahir: Co-founder and CTO of ZenML

April 10, 2025
Say Goodbye To Again Ache With These Desk Add-Ons And Devices

Say Goodbye To Again Ache With These Desk Add-Ons And Devices

December 12, 2025

Trending.

The right way to Defeat Imagawa Tomeji

The right way to Defeat Imagawa Tomeji

September 28, 2025
How you can open the Antechamber and all lever places in Blue Prince

How you can open the Antechamber and all lever places in Blue Prince

April 14, 2025
Satellite tv for pc Navigation Methods Going through Rising Jamming and Spoofing Assaults

Satellite tv for pc Navigation Methods Going through Rising Jamming and Spoofing Assaults

March 26, 2025
Exporting a Material Simulation from Blender to an Interactive Three.js Scene

Exporting a Material Simulation from Blender to an Interactive Three.js Scene

August 20, 2025
The most effective methods to take notes for Blue Prince, from Blue Prince followers

The most effective methods to take notes for Blue Prince, from Blue Prince followers

April 20, 2025

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

My Tackle the Finest Cloud Compliance Software program for 2026 on G2

My Tackle the Finest Cloud Compliance Software program for 2026 on G2

February 1, 2026
Tech Life – Chatbots altering minds

Tech Life – Chatbots altering minds

February 1, 2026
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved