I'm running this PROCEDURE, and it returns this error!
BEGIN
SET @cont = 0;
REPEAT
SET @sqlstring = "UPDATE import2016 SET coluna4 = (SELECT coluna4 FROM import2016 AS a WHERE a.coluna2 ='' and a.coluna4 like'%/%' LIMIT ?,01) WHERE id = (SELECT id+7 FROM import2016 AS a WHERE a.coluna2 ='' and a.coluna4 like'%/%' LIMIT ?,01);";
PREPARE stmt FROM @sqlstring ;
EXECUTE stmt USING @cont,@cont;
DEALLOCATE PREPARE stmt;
SET @cont = @cont +1;
UNTIL @cont = 256
END REPEAT;
END
/* Erro SQL (1093): You can't specify target table 'import2016' for update in FROM clause */
PROCEDURE is on the same bench of the table! I would like to know how I can resolve this error, thank you.