Women in Technology

Hear us Roar



Article:
  SQL Data Types
Subject:   Prove that the combination of two columns are unique
Date:   2006-05-15 15:01:36
From:   vishnulive
How to prove using a query that the combination of two columns are unique in a table which has more than two columns?
Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Prove that the combination of two columns are unique
    2006-08-18 07:52:04  PatTheDBA [View]

    Try this:

    select column1 || column2, count(1)
    from some_table
    group by column1 || column2
    having count(1) > 1


    This will return all rows that are not unique and the number of duplicates