Home Oracle 拼接字符串
Post
Cancel

Oracle 拼接字符串

1、使用||来拼接字符串:

1
select '拼接'||'字符串' as Str from student;

2、使用concat(param1, param2)函数实现:

1
select concat('拼接', '字符串') as Str from student;

注:oracle的concat()方法只支持两个参数,如果拼接多个参数,可以嵌套concat():

1
select concat(concat('拼接', '字符串'), 'ab') as Str from student;
This post is licensed under CC BY 4.0 by the author.