开发者

create multiple default value rows in oracle 11g

select 'a' as st,'x' as ed from dual
union all
select 'b' as st,'y' as ed from dual
union all
select 'c' as st,'z开发者_C百科' as ed from dual

Instead can we write some thing like using directly with pivot/unpivot and connect by cclause in one slect statement


You could do something like this assuming you just want consecutive characters in consecutive rows

SQL> ed
Wrote file afiedt.buf

  1  select chr( ascii('a') + level - 1) st,
  2         chr( ascii('x') + level - 1) ed
  3    from dual
  4* connect by level <= 3
SQL> /

ST   ED
---- ----
a    x
b    y
c    z
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜