Nest query since MySQL can not select and update:

More information
https://stackoverflow.com/a/9843719

Attempts to fix:
'You can't specify target table 'plan_extension_user_values' for update
in FROM clause'
This commit is contained in:
Rsl1122 2019-03-26 14:16:17 +02:00
parent c1a6fdd6fc
commit 40075f697c

View File

@ -92,7 +92,7 @@ public class RemoveUnsatisfiedConditionalResultsTransaction extends Transaction
AND + ExtensionProviderTable.CONDITION + " IS NOT NULL"; // Ignore values that don't need condition
String sql = "DELETE FROM " + playerValueTable +
WHERE + ExtensionPlayerValueTable.ID + " IN (" + selectUnsatisfiedValueIDs + ')';
WHERE + ExtensionPlayerValueTable.ID + " IN (" + SELECT + ExtensionPlayerValueTable.ID + FROM + '(' + selectUnsatisfiedValueIDs + "))";
return new ExecStatement(sql) {
@Override