UPDATE `text` SET `rawtext` = REPLACE(`rawtext`, 'www.olddomain.com', 'www.newsub.olddomain.com') WHERE `rawtext` LIKE '%www.olddomain.com%';