selecting rows based on unique fields in a column - Mailing list pgsql-novice

From John Siggins
Subject selecting rows based on unique fields in a column
Date
Msg-id 3FA8E47E.6020007@blueyonder.co.uk
Whole thread Raw
Responses Re: selecting rows based on unique fields in a column
List 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 by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: DISTINCT ... ORDER BY
Next
From: Manfred Koizar
Date:
Subject: Re: selecting rows based on unique fields in a column