我有这样的表
A B
0abc 3
1c 4
我希望像这样查询空白10次;
A
0abc 3
1c 4
这只是一个例子,这也可能是100个空白。我应该使用哪种功能?
答案 0 :(得分:0)
使用您的示例应该是:
with sqf
as (select --+ choose
'0abc' "A",
3 "B"
from dual
where 1e1 = 1e1
union all
select --+ choose
'1c' "A",
4 "B"
from dual
where 1e1 = 1e1
)
select --+ choose
rpad(s.a, 10) || to_char(s.b) "PADDED_LINE"
from sqf s
where 1e1 = 1e1;
https://docs.oracle.com/database/121/SQLRF/functions107.htm#SQLRF00663