What is the string concatenation operator in Oracle?

What is the string concatenation operator in Oracle SQL?

Are there any "interesting" features I should be careful of?

(This seems obvious, but I couldn't find a previous question asking it).


It is || , for example:

select 'Mr ' || ename from emp;

The only "interesting" feature I can think of is that 'x' || null 'x' || null returns 'x' , not null as you might perhaps expect.


还有concat,但没有太多用处

select concat('a','b') from dual;

I would suggest concat when dealing with 2 strings, and || when those strings are more than 2:

select concat(a,b)
  from dual

or

  select 'a'||'b'||'c'||'d'
        from dual
链接地址: http://www.djcxy.com/p/83724.html

上一篇: 在Oracle SQL Developer中使用tnsnames.ora

下一篇: 什么是Oracle中的字符串连接运算符?