REPEAT DELETE FROM example WHERE eg > 1 LIMIT 5000 UNTIL row_count() = 0 END REPEAT
I've only been able to get something like this to work within a stored procedure like below, which I'd like to avoid if possible.
"""delimiter // CREATE PROCEDURE untilEmpty () BEGIN REPEAT """ + stmt + """ LIMIT 5000; UNTIL ROW_COUNT() = 0 END REPEAT; END// delimiter ; CALL untilEmpty();
I'm using Groovy SQL if that helps.