Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 877339FA418 for ; Fri, 29 Sep 2006 19:00:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 01640-05 for ; Fri, 29 Sep 2006 22:00:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54309.mail.yahoo.com (web54309.mail.yahoo.com [206.190.49.119]) by postgresql.org (Postfix) with SMTP id 13EBF9FB2E4 for ; Fri, 29 Sep 2006 19:00:16 -0300 (ADT) Received: (qmail 40973 invoked by uid 60001); 29 Sep 2006 22:00:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2U9+waWYq4L4Zmx16kNwxJJIxyiyUYV/gNYeTlCzht6w+epgHt9VDWtmA4Tcfb5t8hFcNfe7EfJFLohzAkF4mtPizTlPC2x1h81TqerTkJ0hqscxIDE4nhbQ863QU+QVqsVqgftyo1D8RuvpqajarRp1ZZOOXFvEHZ+2MCP/WTw= ; Message-ID: <20060929220015.40971.qmail@web54309.mail.yahoo.com> Received: from [68.35.2.64] by web54309.mail.yahoo.com via HTTP; Fri, 29 Sep 2006 15:00:15 PDT Date: Fri, 29 Sep 2006 15:00:15 -0700 (PDT) From: chester c young Subject: tree-structured query To: sql pgsql MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2046375539-1159567215=:38642" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.852 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, HTML_40_50, HTML_MESSAGE X-Spam-Level: *** X-Archive-Number: 200609/176 X-Sequence-Number: 26387 --0-2046375539-1159567215=:38642 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit in a simple tree structured table table t( id primary key, pnt_id references t( id ), name ); does anyone know an easy howbeit sneaky way of determining ancestory and decendency without recursive functions, select name from t where exists thanks for insight --------------------------------- Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business. --0-2046375539-1159567215=:38642 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit in a simple tree structured table

table t(
  id primary key,
  pnt_id references t( id ),
  name
);

does anyone know an easy howbeit sneaky way of determining ancestory and decendency without recursive functions,

select name from t where exists <ancestor or descendent>

thanks for insight


Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business. --0-2046375539-1159567215=:38642--