Search Postgresql Archives

happy holidays, christmas etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My little attempt to create christmas tree:

WITH RECURSIVE tree(b, l, lv) AS
 (
  (
   WITH RECURSIVE t(b, l) AS
    (
      select b/11.6, 0 AS l from (select generate_series(0,30)::float8
b union all select generate_series(30,0, -1)::float8 b) ziew
        UNION ALL
      select (b*1.06), l+1 FROM t WHERE l < 3
    )
    select b, l, 1 AS lv from t order by l asc
  )
  UNION ALL
   select b*1.1, l+(lv*62) AS l , lv+1 FROM tree WHERE lv < 4
 )
select array_to_string(array_agg(SUBSTRING('  ....,--++++****####',
LEAST(GREATEST(b::integer,1),20), 1)),'') from tree group by l order
by l asc;


hohoho :P

-- 
GJ

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux