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 data definition language?

823


What are different clauses used in sql?

856


How many types of keys are there in sql?

795


Which sql statement is used to delete data from a database?

690


Which are the different types of indexes in sql?

803


Differentiate pl/sql and sql?

778


What sql does db2 use?

754


what is sp_pkeys? : Transact sql

916


How do I tune a sql query?

760


What is embedded sql in db2?

742


Explain the difference in execution of triggers and stored procedures?

784


What is difference between joins and union?

800


Explian rowid, rownum? What are the psoducolumns we have?

793


What are properties of the transaction?

768


How do I install microsoft sql?

757