I am trying to execute this query. it is to delete all the accounts that is less than the average of all the accounts in the account
table. I am however getting this error:
#1093 - Table 'account' is specified twice, both as a target for 'DELETE' and as a separate source for data
The query is:
DELETE
FROM account WHERE account_number IN
(
SELECT account_number FROM account
WHERE balance < (SELECT AVG (balance) FROM account)
);
How can I solve this problem?