What is that I am doing wrong with the below query
Error Message : You can't specify target table 'cp_asseteventinquiry' for update in FROM clause
Query :
UPDATE cp_asseteventinquiry
SET Due_Date= curdate()
WHERE TopLevelAsset_Num =
(
SELECT Distinct(TopLevelAsset_Num) FROM cp_asseteventinquiry
WHERE cp_asseteventinquiry.History='NO'
AND NOT EXISTS(SELECT Scheduled_Date FROM flightlogs
WHERE flightlogs.Asset=cp_asseteventinquiry.TopLevelAsset_Num
AND flightlogs.Scheduled_Date=date_format (curdate(), '%m/%d/%Y'))
);