SQL Find rows that violate UNIQUE together index

oracle11g, sql

Solution

You can use `Group By` and `Having` for this:

SELECT col1,
       col2
FROM   table
GROUP  BY col1,
          col2
HAVING Count(*) > 1

Basically - group the values, then filter for instances where there is more than one.

Problem

i want to put unique index on two (or more) columns in a table, but i get "duplicate keys found". How to select those rows which cause duplication?

Original source