1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
SELECT * FROM (SELECT array_to_string(array_agg(CASE WHEN (POWER((xx.x - 25), 2) / 130 + POWER((yy.y - 25), 2) / 130) = 1 THEN '$' WHEN (SQRT(POWER(xx.x - 20, 2) + POWER(yy.y - 20, 2))) < 2 THEN '#' WHEN (SQRT(POWER(xx.x - 20, 2) + POWER(yy.y - 30, 2))) < 2 THEN '#' WHEN (SQRT(POWER(xx.x - 29, 2) + POWER(yy.y - 25, 2))) < 4 THEN '#' WHEN (POWER((xx.x - 10), 2) / 40 + POWER((yy.y - 10), 2) / 40) = 1 THEN '$' WHEN (POWER((xx.x - 10), 2) / 40 + POWER((yy.y - 40), 2) / 40 = 1) THEN '$' ELSE ' ' END), ' ') AS cartoon FROM (SELECT generate_series(1, 40) AS x) AS xx, (SELECT generate_series(1, 50) AS y) AS yy GROUP BY xx.x ORDER BY xx.x) AS co_ord
|