Re: Wrote a connect-by feature

Поиск
Список
Период
Сортировка
От Bertram Scharpf
Тема Re: Wrote a connect-by feature
Дата
Msg-id 20070808120423.GA13412@bart.bertram-scharpf.homelinux.com
обсуждение исходный текст
Ответ на Wrote a connect-by feature  (Bertram Scharpf <lists@bertram-scharpf.de>)
Ответы Re: Wrote a connect-by feature
Список pgsql-hackers
Hi,

Am Mittwoch, 08. Aug 2007, 00:52:41 +0200 schrieb Bertram Scharpf:
>   <http://www.bertram-scharpf.de/tmp/connectby.tar.gz>

I just extended it. Below an example.

Bertram


--------------------------------

select * from simp;
id | pid |   nam    
----+-----+---------- 1 |     | Abe 2 |   1 | Homer 3 |   2 | Bart 4 |   2 | Lisa 5 |   2 | Maggie 6 |     | Ned 7 |
6| Rod 8 |   6 | Todd 9 |     | Clancy10 |   9 | Ralph11 |     | Hyman12 |  11 | Herschel
 
(12 rows)


select repeat('  ',t.lev)||(case when t.term then '`' else '|' end)||'-'||s.nam   from connectby_all( 'simp', 'id',
'pid','nam asc', null, null)       as t (id integer, pid integer, lev integer, pos integer, term boolean)   join simp
ass on (t.id=s.id);
 
   ?column?    
----------------  |-Abe    `-Homer      |-Bart      |-Lisa      `-Maggie  |-Clancy    `-Ralph  |-Hyman    `-Herschel
`-Ned   |-Rod    `-Todd
 
(12 rows)


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Brendan Jurd"
Дата:
Сообщение: Function structure in formatting.c
Следующее
От: "Pavan Deolasee"
Дата:
Сообщение: GUC for default heap fillfactor