我有这个sql:
with p_1 as
(
select 1 sorszam, 'X1' tipus from dual
union all select 2 sorszam, 'X2' tipus from dual
union all select 3 sorszam, 'X3' tipus from dual
)
select (
(case when p1.sorszam=1 then ('[' || chr(13) || chr(10)) else '' end) ||
p1.tipus
|| (case when p1.sorszam=(select max(sorszam) from p_1) then (chr(13) || chr(10) || ']') else '' end)
) szoveg
from p_1 p1
order by p1.sorszam
结果是:
SZOVEG
--------
[
X1
X2
X3
]
我的问题是:为什么第一行后面会出现空白?
答案 0 :(得分:0)
使用SET RECSEP OFF
删除记录分隔符。
http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12040.htm#i2699269