UPDATE
work_info as info1
SET
info1.status_id = 1
WHERE
info1.info_id IN(
SELECT info2.info_id
FROM work_info as info2
WHERE info2.info_id IN (
SELECT MAX(info3.info_id)
FROM work_info as info3
GROUP BY info3.user_license_id)
AND info2.status_id = 5)
Getting this error #1093 – You can’t specify target table ‘info1’ for update in FROM clause
2
Answers
because it is the same table, you can trick and do :
[update or delete or whatever]
https://www.codeproject.com/Tips/831164/MySQL-can-t-specify-target-table-for-update-in-FRO#:~:text=Some%20days%20back%20while%20writing,select%20as%20your%20update%20criteria.
Directly (without trying to understand the logic of the query):