I have a project where I have to do a update
of a table field (active) , I practically have something like this:
UPDATE
t1
INNER JOIN
(SELECT
MAX(id)
FROM
t2_copy
GROUP BY idq
ORDER BY idq DESC)AS x2
SET activa = TRUE
WHERE x2.id
I copied the table to create a subquery. from it and do a inner join
to include it and where the id_max
is equal to the id update
But I get an error that you do not know x2.id
for example as if you do not accept the alias.