clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3364508 fiddles created (36289 in the last week).

SELECT VERSION();
VERSION()
8.0.27
 hidden batch(es)


SELECT REGEXP_REPLACE('567890', '[7]', 'z');
REGEXP_REPLACE('567890', '[7]', 'z')
56z890
 hidden batch(es)


DROP TABLE IF EXISTS `test`;
 hidden batch(es)


CREATE TABLE IF NOT EXISTS `test` ( `field` TEXT );
 hidden batch(es)


INSERT INTO `test` (`field`) VALUES ('567890');
 hidden batch(es)


UPDATE `test` SET `field` = REGEXP_REPLACE(`field`, '[7]', 'z');
 hidden batch(es)


SELECT `field` FROM `test`;
field
56z890
 hidden batch(es)


UPDATE `test` SET `field` = '567890';
 hidden batch(es)


SELECT `field` FROM `test`;
field
567890
 hidden batch(es)


UPDATE `test` SET `field` = CAST(REGEXP_REPLACE(`field`, '[7]', 'z') AS CHAR);
 hidden batch(es)


SELECT `field` FROM `test`;
field
56z890
 hidden batch(es)