IS there a way to loop an update statement in mysql using mysql script. My code shown below
UPDATE table_name
SET column_name(REPLACE(column_name,Char(16), '')
I want that to loop from 16 to 31. Kindly advice.
I tried creating a script such as the one below
DELIMETER $$
CREATE DEFINER `root`@`localhost` PROCEDURE `myupdate`()
BEGIN
DECLARE c INT;
SET c 16;
WHILE c < 31 DO
UPDATE table_name
SET column_name = replace(column_name, char(16), '');
commit;
SET c = c + 1;
END WHILE;
END
Kinda wrong if you ask me but I'm so new here in mysql. Kindly advice sir and Madam and Thanks in advance.