From: | Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | happy holidays, christmas etc. |
Date: | 2008-12-24 14:45:49 |
Message-ID: | 2f4958ff0812240645w1cf2e453u479b02486bc6976a@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Roderick A. Anderson | 2008-12-24 15:17:34 | Multi-tenant cluster |
Previous Message | Pavel Stehule | 2008-12-24 14:19:22 | Re: return query and function result type must be real because of OUT parameters |