oracle 将 不同列 的值 拼接成一个 字符串 --利用拼接操作符ldquo;||rdquo;或者 concat(
oracle 将 不同列 的值 拼接成一个 字符串
--利用拼接操作符“||”或者 concat('','')函数,将不同列的值 拼接成一个 字符串
-- 方法一:推荐
select s.team ||'**'|| s.name ||'**'|| s.job_number
from staff s where s.pass ='123456' and s.team ='南方'
--方法二:繁琐。
select concat( concat( concat( concat(s.team,'**' ),s.name) ,'**') , s.job_number)
from staff s where s.pass ='123456' and s.team ='南方'
--结果均一样如下
南方**陈某某**110320
南方**彭某某**119008
南方**黄某某**119083
,