-
Junior Member
-
Expert Member
Re: difference bet unique and distinct
Hi Smitai,
The keywords, DISTINCT and UNIQUE are synonymous.
Both are used to specify to return only one copy of each set of duplicate rows selected.
One restriction is that DISTINCT cannot be specified if the FROM clause contains LOB columns.
*** Innila ***
-
Junior Member
Re: difference bet unique and distinct
UNIQUE we are inserting unique data to table
DISTINCT means we are retriving unique values from duplicate records
-
Junior Member
Re: difference bet unique and distinct
Both are same but distinct use in sql as well in oracle but unique only use for oracle
-
Junior Member
Re: difference bet unique and distinct
Unique:
SQL> insert into emp values(eno number(4) unique,ejob varchar(15));
Here unique restricts the user to enter the same value more than once.
Error:Voilating constraint
Distinct:
SQL>select distinct(ejob) from emp;
Here distinct is used to eliminate the duplicate values from emp. i.e ejob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules