• 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 ten+ Finest AI & Professional Net Design Instruments for 2025 — SitePoint

The ten+ Finest AI & Professional Net Design Instruments for 2025 — SitePoint

March 30, 2025
Balatro on Nintendo Swap Drops to Simply $19.99 for Amazon Prime Day

Balatro on Nintendo Swap Drops to Simply $19.99 for Amazon Prime Day

July 10, 2025

Trending.

Microsoft Launched VibeVoice-1.5B: An Open-Supply Textual content-to-Speech Mannequin that may Synthesize as much as 90 Minutes of Speech with 4 Distinct Audio system

Microsoft Launched VibeVoice-1.5B: An Open-Supply Textual content-to-Speech Mannequin that may Synthesize as much as 90 Minutes of Speech with 4 Distinct Audio system

August 25, 2025
New Assault Makes use of Home windows Shortcut Information to Set up REMCOS Backdoor

New Assault Makes use of Home windows Shortcut Information to Set up REMCOS Backdoor

August 3, 2025
Begin constructing with Gemini 2.0 Flash and Flash-Lite

Begin constructing with Gemini 2.0 Flash and Flash-Lite

April 14, 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
Menace Actors Use Pretend DocuSign Notifications to Steal Company Information

Menace Actors Use Pretend DocuSign Notifications to Steal Company Information

May 28, 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

I Examined Herahaven AI Chat App for 1 Month

I Examined Herahaven AI Chat App for 1 Month

September 22, 2025
The trade traits each marketer ought to know

The trade traits each marketer ought to know

September 22, 2025
  • 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