Re: selecting rows based on unique fields in a column

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: selecting rows based on unique fields in a column
Дата
Msg-id ef0iqvcepq0durqp8e7vb8jqj726dubgok@email.aon.at
обсуждение исходный текст
Ответ на selecting rows based on unique fields in a column  (John Siggins <j-siggins@blueyonder.co.uk>)
Ответы Re: selecting rows based on unique fields in a column  (John Siggins <j-siggins@blueyonder.co.uk>)
Список pgsql-novice
On Wed, 05 Nov 2003 11:52:30 +0000, John Siggins
<j-siggins@blueyonder.co.uk> wrote:
>   select reqitem from lasting
>group by reqitem having count(reqitem) = 1;
>
>But this gives me only reqitem column and I want the rest of the row!

SELECT l.*
  FROM lasting AS l INNER JOIN (
       SELECT reqitem FROM lasting
        GROUP BY reqitem HAVING count(reqitem) = 1
       ) AS x ON l.reqitem = x.requitem;

Servus
 Manfred

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

Предыдущее
От: John Siggins
Дата:
Сообщение: selecting rows based on unique fields in a column
Следующее
От: John Siggins
Дата:
Сообщение: Re: selecting rows based on unique fields in a column