I have a table with these columns:

id, node, parent_node_id

The top-most nodes would have a parent_node_id of
NULL. Is it possible to get a node, and all its parent
nodes, in a single query?

For example, a node might be:

books > computers > databases > oss > postgres

and the rows fetched would be:

1,books,NULL
2,computers,1
3,databases,2
4,oss,3
5,postgres,4

TIA,
CSN



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to