Verification of the Uniqueness (UNIQUE)
Use this to verify if the rows of a number of columns cols are unique. This is the case if the specified columns cols do not contain data records in duplicate. Rows in the specified columns cols which only contain NULL values are classified as being unique (even if there is more than one). Non-unique rows are selected.
- You need either the system privilege USE ANY SCHEMA or the object privilege USAGE on the target schema(s), or the schema(s) must be owned by you or one of your assigned roles.
- You need either the system privilege SELECT ANY TABLE or the SELECT object privilege on tables or views which are referenced in the SELECT list, or the tables or views must be owned by you or one of your assigned roles.
- In the formulation without select_list, the columns to be checked for uniqueness are selected.
- ROWNUM cannot be used in combination with this statement.
- Verification of uniqueness occurs directly in the table specified in the FROM clause. It is not until WHERE, GROUP BY, and similar are used on the table with the columns that violate the uniqueness.
The following examples relate to this table: