Multi-table DELETE

82 views
Skip to first unread message

jdoe

unread,
Apr 29, 2016, 3:49:22 PM4/29/16
to jOOQ User Group
Hello!

I'm wondering if there's any possibility to add table names between DELETE and FROM in order to make something like this (MySQL):

DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3
WHERE t1.id=t2.id AND t2.id=t3.id;

Lukas Eder

unread,
Apr 30, 2016, 10:50:39 AM4/30/16
to jooq...@googlegroups.com
Hello,

Thank you very much for this suggestion. This is currently not supported in jOOQ, out-of-the-box. But it should be. I've created a feature request for this:

In the meantime, you can resort to "plain SQL":

Or to patching the SQL statement using an ExecuteListener.

Cheers,
Lukas


--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

unread,
May 28, 2021, 5:04:40 AMMay 28
to jOOQ User Group
jOOQ 3.15 will support multi table DELETE statements via explicit JOINs in FROM: https://github.com/jOOQ/jOOQ/issues/11924 and single table DELETE statements with USING clause: https://github.com/jOOQ/jOOQ/issues/11925

Listing the tables to delete from is not yet possible

Reply all
Reply to author
Forward
0 new messages