473,549 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connectby

hi

I have menu table:
id | integer | not null default
nextval('public .menu_id_seq':: text)
parent_id | integer |
description | text |

I do select:
test=> SELECT * FROM connectby('menu ','id','parent_ id','2',0,'~') t(id
integer, parent_id integer, level int, branch text);
id | parent_id | level | branch
----+-----------+-------+-------------
2 | | 0 | 2
4 | 2 | 1 | 2~4
7 | 4 | 2 | 2~4~7
10 | 7 | 3 | 2~4~7~10
16 | 10 | 4 | 2~4~7~10~16
9 | 4 | 2 | 2~4~9

How am I able to select description file from menu table, not only id,
parent_id, level, branch fields?

--
WBR, sector119
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
0 2321

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2480
by: Kuldeep Tanna | last post by:
Hi, I tried make in the tablefunc directory under contrib directory in the Posgresql source directory. I am getting compilation errors. Below are the error messages. Can you tell me how to solve this problem. I want to use the crosstab function. tablefunc.c: In function `crosstab': tablefunc.c:413: warning: implicit declaration of function...
5
15061
by: D. Dante Lorenso | last post by:
I have a simple table that I'd like to query to pull out a heirarchy from a tree relationship. What is the best way to do this without a 'CONNECT BY' clause like Oracle has? Example mytable +----------+-----------+ | child_id | parent_id |
13
5870
by: Anton.Nikiforov | last post by:
Hello everybody! Does someone know how to build hierarchical queries to the postgresql? I have a table with tree in it (id, parent) and need to find a way from any point of the tree to any other point. And i would like to have a list of all steps from point A to point B to make some changes on each step (this is required by the...
0
1431
by: Murray Bryant | last post by:
I am having problems with contrib/tablefunc in postgresql 7.4.1 on freebsd when i try to make install i get the errors below. I am unable to make the 7.3 -> 7.4 transition until i can get the connectby function to work as i use it all the time. Can anyone suggest anything that i can do to get the connectby function
18
1933
by: Mike MacSween | last post by:
I have an app I need a hierachical structure for. There seem to be 3 ways of implementing this, as far as I can see: 1. Adjacency list. Pros - intuitive and relatively simple Cons - not easily accesible via standard SQL, needs recusive queries to crawl up or down the structure. I'll be doing this in Jet or perhaps MS SQL Server, so...
4
3640
by: David Garamond | last post by:
May I request that connectby() supports BYTEA keys too? My keys are GUID (16-byte stored in BYTEA). In this case, branch_delim does not make sense because the keys should be fixed-length anyway, unless if connectby() also wants to support outputing the branch as encoded text. Btw, is recursive join (CONNECT BY ...) in SQL standard? (I have a...
2
1812
by: David Parker | last post by:
I know this question has been discussed, probably multiple times, but I can't seem to access archives.postgresql.org today.... I need to select all the rows in a table with two fields: parent_id and child_id that participate in the same logical "tree". In other words, given an id value, I want to find where child_id = my-value, and then...
1
1155
by: Net Virtual Mailing Lists | last post by:
Hello, I have 3 tables which are joined that I need to create a summation for and I just cannot get this to work. Here's an example: CREATE table1 ( id1 INTEGER, title1 VARCHAR
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7967
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5377
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.