orcal查询结果多列拼接成一列字符串
工作中碰到的一些问题,做些简单的记录,方便自己复习和成长
将fill_usercode字段和fill_time字段拼接,并且拼接些说明:如下图
select ('分配人id:' || n.fill_usercode|| '-' || '分配时间' ||to_char(n.fill_time,'yyyy-MM-dd HH:mi:ss'))as nameandtime
from miss_people_form n
where n.ajbh = '123456789'
查询结果:
将查询结果中ID列,所有数据以逗号分隔拼接在一起。
select wm_concat(id) from score where score>95
查询结果: