If the table has a decent amount of data, it might be easier to make
SELECT ta, tb, tc, count(*) FROM my_table t GROUP BY ta, tb, tc HAVING COUNT(*) > 1
If this query returns 0 rows, the three columns (currently) are unique. If this query returns 1 or more rows, you will know which values ββare duplicated.
Of course, if you find that the three columns are currently unique, you need to create a unique constraint if you intend to use this fact.
source share