Differences between UNIQUE and DISTINCT in select statements
Answer Posted / david alexander
There is some confusion here. Yes, UNIQUE is a constraint,
but the question is not about constraints, its about a
select statement. And, to answer it quite simply, its a
trick question. There is no difference. Although I always
see it as DISTINCT. Here is the quote from Oracle® Database
SQL Reference 10g Release 2 (10.2):
"Specify DISTINCT or UNIQUE if you want the database to
return only one copy of each set of duplicate rows
selected. These two keywords are synonymous. Duplicate rows
are those with matching values for each expression in the
select list."
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What are instead of triggers?
Can 2 queries be executed simultaneously in a distributed database system?
What is orm in sql?
what is the difference between truncate and delete statement? : Transact sql
What are the events on which a database trigger can be based?
Define commit, rollback and savepoint?
how to shut down the server with 'mysqladmin'? : Sql dba
Can we use delete in merge statement?
What are tuples in sql?
What does pl sql stand for?
What is a sql trace file?
How can you select unique records from a table?
Why is nosql good?
what is the difference difference between procedure and packages
Is mariadb a nosql database?