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 the difference between an inner and outer join?
What plvcmt and plvrb does in pl/sql?
what is blob? : Sql dba
write an sql query to find names of employee start with 'a'? : Sql dba
Which command is used to delete a package?
what is a relationship and what are they? : Sql dba
What is indexing in sql and its types?
what are the advantages a stored procedure? : Sql dba
How do I view a sql trace file?
What are sql triggers used for?
how to drop an existing index in mysql? : Sql dba
What is pl/sql table? Why it is used?
What does joining a thread mean?
What are sql ddl commands?
How do you clear the screen in sql?