I have a table that contains an oldid and an oldparid. I want to update the rows where row.oldpar = otherrow.oldid but I'm having a problem with my query.
UPDATE 01_menu_main SET parid = x.newpar
FROM (SELECT oldid, id as newpar FROM 01_menu_main) x
WHERE x.oldid = 01_menu_main.oldpar
The error I'm receiving is this
Is there something I'm missing? Thanks!