you can't specify target table for updatein from caluse

Viewed 12

i have one table table name is cars there are some duplicate in my records

1   Model S  Tesla               Blue       2018
2   EQS      Mercedes-Benz       Black      2022
3   iX       BMW                 Red        2022
4   Ioniq 5  Hyundai             White      2021
5   Model S  Tesla               Silver     2018
6   Ioniq 5  Hyundai             Green      2021

while deleting the records the records showing the error

DELETE FROM CARS
WHERE ID IN (
SELECT MAX(ID) FROM CARS GROUP BY MODEL,BRAND
HAVING COUNT(*)>1);

here is the code plz meenter image description here

0 Answers
Related