• 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.

The Sims Board Recreation No person Requested for Was Quietly Launched at Goal Final Month

The Sims Board Recreation No person Requested for Was Quietly Launched at Goal Final Month

August 8, 2025
8BitDo All-Button Arcade Combat Pads On Sale For Greatest Costs But

8BitDo All-Button Arcade Combat Pads On Sale For Greatest Costs But

January 3, 2026

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
Learn how to Set Up the New Google Auth in a React and Specific App — SitePoint

Learn how to Set Up the New Google Auth in a React and Specific App — SitePoint

June 2, 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

Actual-Time Vishing Is Breaking MFA

Actual-Time Vishing Is Breaking MFA

February 1, 2026
What’s the open internet? • Yoast

What’s the open internet? • Yoast

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