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


Please Help Members By Posting Answers For Below Questions

Is natural join and inner join same?

485


Which is faster union or join?

484


what are tables and fields? : Sql dba

569


Can a trigger call a stored procedure?

529


What is the usage of the distinct keyword?

677






How to fix oracle error ora-00942: table or view does not exist

562


what is a view? : Sql dba

628


How to call a javascript function from pl sql?

554


What is parallel hint?

739


What are the parts of a sql statement?

544


How can a function retun more than one value in oracle with proper example?

574


what is a table in a database ? : Sql dba

532


what is innodb? : Sql dba

569


Why is a primary key important?

537


Which data dictionary views have the information on the triggers that are available in the database?

741