From: Oleg Bartunov <oleg@sai.msu.su>
To: pgsql-sql@postgresql.org
Subject: help with query
Date: Tue, 23 Jan 2001 21:11:49 +0300 (GMT)
Message-ID: <Pine.GSO.4.31.0101232050410.12851-100000@ra.sai.msu.su> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: oleg@sai.msu.su
Subject: Re: help with query
In-Reply-To: <Pine.GSO.4.31.0101232050410.12851-100000@ra.sai.msu.su>
References: <Pine.GSO.4.31.0101232050410.12851-100000@ra.sai.msu.su>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox