一、拼接字符串
1、使用“||”来拼接字符串: select '拼接'||'字符串' as Str from student; 2、使用concat(param1,param2)函数实现: select concat('拼接','字符串') as Str from student; 注:oracle的concat()方法只支持两个参数,如果拼接多个参数,可以嵌套concat(): select concat(concat('拼接','字符串'),'ab') as Str from student;
select name as Str from account; --使用双竖线来连接两个字符串 select '拼接'||'字符串' as Str,name from account; --和现有字段拼接 select '用户名:'||name as Str from account; --拼接多个字符串 select '拼接'||'字符串'||'222字符串' as Str,name from account; --使用系统内置的函数来拼接 但是它只能拼接两个字符串 select concat('拼接','字符串') as Str from account; --如果要使用函数来拼接多个字符串 可以调用 多次concat select concat(concat('拼接','字符串'),'ab') as Str from account;