[SQL] Most recent row

Поиск
Список
Период
Сортировка
От Gary Stainburn
Тема [SQL] Most recent row
Дата
Msg-id 201705050925.04194.gary.stainburn@ringways.co.uk
обсуждение исходный текст
Ответы Re: [SQL] Most recent row  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Re: [SQL] Most recent row  (vinny <vinny@xs4all.nl>)
Re: [SQL] Most recent row  (hubert depesz lubaczewski <depesz@depesz.com>)
Re: [SQL] Most recent row  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql
This question has been asked a few times, and Google returns a few different 
answers, but I am interested people's opinions and suggestions for the *best* 
wat to retrieve the most recent row from a table.

My case is:

create table people ( p_id  serial primary key,......
);

create table assessments ( p_id    int4 not null references people(p_id), as_timestamp    timestamp not null, ......
);

select p.*, (most recent) a.*  from people p, assessments a ..
;



В списке pgsql-sql по дате отправления:

Предыдущее
От: Hector Vass
Дата:
Сообщение: Re: [SQL] Please advice on query optimization
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: [SQL] Most recent row