SELECT DISTINCT ON bug?

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема SELECT DISTINCT ON bug?
Дата
Msg-id 3ECB1E39.7080309@mega-bucks.co.jp
обсуждение исходный текст
Ответы Re: SELECT DISTINCT ON bug?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
The following query give an error in 7.3

TAL=# SELECT distinct on(dai_genres.id), dsc from dai_genres,
rel_genres_goods where dai_genres.id=rel_genres_goods.major_id group by
id, dsc;
ERROR:  parser: parse error at or near "," at character 34

I looked up the 7.3 docs and I thought I had the syntax right.

What's the proper syntaxt for the above query (selecting unique id's and
their associated dsc from the two tables joined on id=major_id)

Thanks.

PS I was doing this query using GROUP BY but using distinct (on) seems
like it should be faster, but I can't test it until I get the query
running ...

--

Jean-Christian Imbeault


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: PRIMARY KEYS
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: pam-linux, /etc/shadow : HOW-TO