selecting rows based on unique fields in a column

Поиск
Список
Период
Сортировка
От John Siggins
Тема selecting rows based on unique fields in a column
Дата
Msg-id 3FA8E47E.6020007@blueyonder.co.uk
обсуждение исходный текст
Ответы Re: selecting rows based on unique fields in a column  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-novice
Hi,
    Is there an easy way to select all rows which have a single entry in a
particular column from those that have multiple entries.

At present I'm using

   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!

I can see how to do this by creating another table updating it with the
above and then selcting into the table all the rest of the row, but is
there an easier way, have I missed something obvious?

Thanks for any response.

John S





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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: DISTINCT ... ORDER BY
Следующее
От: Manfred Koizar
Дата:
Сообщение: Re: selecting rows based on unique fields in a column