Oracle Select Distinct Statement
The Oracle SELECT DISTINCT statement is used to fetch unique record and remove duplicates from the result set. In Oracle, the DISTINCT clause doesn't ignore NULL values.
Note: When only one column is provided in the DISTINCT clause, the query will return the unique values for that column.
When more than one columns is provided in the DISTINCT clause, the query will retrieve unique combinations for the column listed.
Oracle SELECT Distinct Statement Syntax
To select the existing table, use the following syntax:
Parameters:
tablename: The table name from which you want to fetch data.
conditions: The conditions optional parameter.
Oracle SELECT Distinct Statement examples
The following Oracle distinct statement to fetch unique records and remove duplicates from the result set:
Note:
In the above example, we are removing duplicates record for selected fields.
Oracle SELECT DISTINCT Statement examples With Multiple Fields
The following Oracle statement to select or fetch unique records and remove duplicates from the result set:
Note:
In the above example, we are fetching unique records in multiple fields.