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


Please Help Members By Posting Answers For Below Questions

What is the purpose of a secondary key?

752


What is a temporal data type?

830


Explain what is sql?

873


how can we know the number of days between two given dates using mysql? : Sql dba

819


How do I count rows in sql query?

771


What is difference between procedure and trigger?

741


Can we create foreign key without primary key?

754


Why is theta join required?

880


What does where 1/2 mean in sql?

829


What are the types of index in sql?

836


What is the advantage of nosql?

804


What is sql prepared statement?

789


How does index help in query performance?

811


What are the types pl/sql code blocks?

875


what is primary key? : Sql dba

766