Chinaunix

标题: oracle 连接单引号 [打印本页]

作者: lxl0121    时间: 2011-12-19 13:56
标题: oracle 连接单引号

Oracle 字符串连接单引号:

1.       首尾单引号为字符串识别标识,不做转译用

2.       首尾单引号里面如果出现的单引号,并且有多个,则相连两个单引号转译为一个字符串单引号

3.       单引号一定成对出现,否者这个字符串出错,因为字符串不知道哪个单引号负责结束。



select to_char('aaa')from dual;
select 
'' || to_char('aaa') || ''from dual;
select 
'''' || to_char('aaa') || '''' from dual;
select 
'''''' || to_char('aaa') || '''''' from dual;
select 
'''''''' || to_char('aaa') || '''''''' from dual;
select 
' '' ' ||' ' || ' '' ' || to_char('aaa') || ' '' '' ' from dual;






欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2