示例:
select 'select a.xh,a.dj,a.xzb from xsjbxxb a where a.xzb=' || chr(39) || a.xzb || chr(39) || ' order by dj desc for update;'
from xsjbxxb a
结果:
select a.xh,a.dj,a.xzb from xsjbxxb a where a.xzb='机191' order by dj desc for update;
select a.xh,a.dj,a.xzb from xsjbxxb a where a.xzb='自动化类195' order by dj desc for update;
select a.xh,a.dj,a.xzb from xsjbxxb a where a.xzb='印191' order by dj desc for update;
说明:
要显示的字符串用一对单引号表示
连接字符串的运算符是 ||
chr(39)表示单引号