update dede_addonarticle set body = replace(cast(body) as varchar) , '<img' , '<img alt = "' + dede_archives.title + '"') from dede_addonarticle,dede_archives where dede_addonarticle.aid = dede_archives.aid;
因为title字段是varchar类型,body是mediumtext类型所以这里要转换!
在MS-SQL里测试执行成功了!在MYSQL执行发生错误!
估计是类型转换那些有问题!还是MYSQL的UPDATE不支持的from,请大家帮忙分析下错误!要怎么改..
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'varch
ar) , '<img' , '<img alt = "' + dede_archives.title + '"') from dede_addona' at
line 1