|
趣题 输出五角星那个有意思...
瞄了半天,刚刚看懂
照搬原版代码。输出一个奥迪吧
with a as ( select distinct a.x + 32*b.l x,a.y y from
(select distinct round(sum(x) over(order by n)) x,
round(sum(y) over(order by n)) y
from (select n,
cos(trunc(n / 2) * (1-9/10) * 3.1415926) * 3 x,
sin(trunc(n / 2) * (1-9/10) * 3.1415926) y
from (select rownum - 1 n from all_objects where rownum <= 2 * 20))) a,
(select level - 1 l from dual connect by level < 5) b
)
select replace(sys_connect_by_path(point, '/'), '/', null) "奧迪"
from (select b.y, b.x, decode(a.x, null, ' ', '*') point
from a,
(select *
from (select rownum - 1 + (select min(x) from a) x
from all_objects
where rownum <= (select max(x) - min(x) + 1 from a)),
(select rownum - 1 + (select min(y) from a) y
from all_objects
where rownum <= (select max(y) - min(y) + 1 from a))) b
where a.x(+) = b.x
and a.y(+) = b.y)
where x = (select max(x) from a)
start with x = (select min(x) from a)
connect by y = prior y
and x = prior x +1;
|
|