1.mysql的SQL语句拼接



--单引号转义
update table1 set Column1='你好';

--首尾的单引号变为三个单引号, '-->'''
--句内的单引号变为一个单引号+连接符+三个单引号, '-->'||'''
--Column2值为: and a.categorycode = '004' and a.desc7 = '正常'
update table1 set Column2='and a.categorycode = '||'''004'''||' and a.desc7 = '||'''正常''';