2009/12/1 Antonio Cesar <[email protected]>:
> pessoal tenho um problema com uma tabela funcionaro onde preciso
> retornar a arvore.
> superior e subordinados.
>
> tabela
> codigo
> nome
> codigo_superior
>


Se estiver utilizando a versão 8.4.x veja a cláusula WITH RECURSIVE.
http://www.postgresql.org/docs/current/interactive/queries-with.html
Veja também a palestra do Leandro na PgCon 2009.

Se for uma versão anterior veja o contrib tablefunc/connectby.
http://www.postgresql.org/docs/8.3/interactive/tablefunc.html

Osvaldo
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a