Oracle SQL中的字符串连接运算符是什么?
有没有什么“有趣”的特性是我应该注意的?
(这似乎很明显,但我找不到之前问它的问题)。
发布于 2008-11-10 15:45:07
它是||
,例如:
select 'Mr ' || ename from emp;
我能想到的唯一“有趣”的特性是'x' || null
返回'x'
,而不是您可能期望的null
。
发布于 2008-11-10 22:09:12
也有concat,但用得不多
select concat('a','b') from dual;
发布于 2015-11-11 16:57:10
我建议在处理2个字符串时使用concat,当这些字符串大于2时||建议使用concat:
select concat(a,b)
from dual
或
select 'a'||'b'||'c'||'d'
from dual
https://stackoverflow.com/questions/278189
复制相似问题