help with query - Mailing list pgsql-sql

From Oleg Bartunov
Subject help with query
Date
Msg-id Pine.GSO.4.31.0101232050410.12851-100000@ra.sai.msu.su
Whole thread Raw
List pgsql-sql
Hi,

I have  a table messages which has (for simplicity) two columns  -
msg_id, last_id, where last_id is sort of symbolical link -
it points to the msg_id of the last version of message.
There are no limitation to the number of versions.
The problem I have is to get history of message with given
MSG_ID.

simple example - message with MSG_ID=1 has changed by editors
(1 - 2 - 3 ... 11) and last version has msg_id=11.
Data are shown only for this specific case, there are much more
data for different MSG_ID.

msg_id, last_id
---------------
11,
...
3,4
2,3
1,2

I need to get msg_id of all messages which parent is MSG_ID.
(hmm, probably I have to get this example as (parent, child)example)

Regards,    Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83



pgsql-sql by date:

Previous
From: "David Wall"
Date:
Subject: Re: blobs and small binary objects
Next
From: ""
Date:
Subject: SQL Query Results