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 difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

775


What is rename command in sql?

684


What is the command used to fetch first 5 characters of the string?

1121


Is json a nosql?

738


Is sql free?

691


What is the difference between a database and a relational database?

790


How many joins can you have in sql?

703


What is tuple in sql?

747


How to select 10 records from a table?

871


What is database migration?

713


Which sql statement is used to return only different values?

737


Does truncate free space?

722


Is and as keyword in pl sql?

703


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2206


What is the difference between a primary key and a clustered index?

713