Differences between UNIQUE and DISTINCT in select statements
Answer Posted / qman*
The two keywords are only synonymous in regards to a SELECT
statement, and also ONLY in an Oracle environment. DISTINCT
is an ANSI standard where as UNIQUE can only be used this
way in Oracle. To further the differences between the two,
UNIQUE may also be used in a table creation statement to
specify that inputs into the specified column cannot share
the same value, and if attempted will result in a
constraint violation error, I hope this clears things up.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
what is query cache in mysql? : Sql dba
List the ways to get the count of records in a table?
What is pivot in sql?
Why join is faster than subquery?
What are pl sql data types?
Is sql port 1433 encrypted?
Do we need to rebuild index after truncate?
What is difference between mysql and postgresql?
What are the ddl commands?
What is record type in pl sql?
What are different methods to trace the pl/sql code?
What is the difference between having clause and where clause?
What is implicit cursor in pl sql?
How to know the last executed procedure?
What is file based approach?