Multiple rows with the same values ββin all columns make no sense. OK - the question may be a way to fix this particular situation.
Given this table, with the identifier is PK:
kram=# select * from foba;
id | no | name
----+----+---------------
2 | 1 | a
3 | 1 | b
4 | 2 | c
5 | 2 | a,b,c,d,e,f,g
you can extract a sample for each single no (: = location) by grouping by this column and selecting a row with a minimum PK (for example):
SELECT * FROM foba WHERE id IN (SELECT min (id) FROM foba GROUP BY no);
id | no | name
2 | 1 | a
4 | 2 | c
source
share