Re: Problems with HAVING

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Problems with HAVING
Дата
Msg-id 20050112171121.GA94838@winnie.fuhr.org
обсуждение исходный текст
Ответ на Problems with HAVING  (Kaloyan Iliev Iliev <news1@faith.digsys.bg>)
Ответы Re: Problems with HAVING  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-sql
On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote:

> My problem is that I want to select the row with max(date) but also 
> limited with where clauses.

If you don't mind using a non-standard feature then try SELECT
DISTINCT ON (not just DISTINCT, but DISTINCT ON):

http://www.postgresql.org/docs/7.4/static/sql-select.html#SQL-DISTINCT

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: KÖPFERL Robert
Дата:
Сообщение: Syntax error while altering col-type
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Syntax error while altering col-type