Re: viewing the original order of entered records
От | scott.marlowe |
---|---|
Тема | Re: viewing the original order of entered records |
Дата | |
Msg-id | Pine.LNX.4.33.0306131439010.21088-100000@css120.ihs.com обсуждение исходный текст |
Ответ на | viewing the original order of entered records ("Sven Van Acker" <Sven.Van.Acker@vub.ac.be>) |
Список | pgsql-general |
On Tue, 10 Jun 2003, Sven Van Acker wrote: > Hi > > > > I've the following problem: > > > > I have a 2-column table with columns "person_id"(int4) and "phase"(text). > > > > When I entered the following records in a chronological fashion: <1, "high > school">; <1, "childhood"> and <2, "university">; > > > > > > I requested the following select-statement. > > > > SELECT person_id, phase FROM life ORDER BY person_id > > > > And found the tuple <1, "childhood"> before the tuple <1, "high school">. > > > > I want to view the chronological order of my entries, but ordered by > person_id. > > Is this possible in postgresql? Yes, just make sure and store a date/time stamp when you insert the records. You can use a before trigger to update a time stamp field on every update of the row. Note that without a field to "order by" neither postgresql nor any other database guarantees any particular return order.
В списке pgsql-general по дате отправления: