Reputation: 86837
This will give me all unique entries:
select distinct (origin, destination) from mytable
but how can I select all routes that are non-unique instead? So I get the rows that are dublicate regarding these 2 fields?
Upvotes: 2
Views: 142
Reputation: 29051
Try this:
SELECT origin, destination
FROM mytable
GROUP BY origin, destination
HAVING COUNT(*) > 1
Upvotes: 5