Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

difference bet unique and distinct

This is a discussion on difference bet unique and distinct within the Oracle Certification forums, part of the Certification category; Is threre any difference bet 'disinct' and 'unique' key word used in select clause ex select disinct(column_name) from table_name; select unique(column_name) from table_name;...

Go Back   Geeks Talk > Certification > Oracle Certification
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Oracle Certification Talk about Oracle Certification

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2007
Junior Member
 
Join Date: Feb 2007
Location: bombay
Posts: 22
Thanks: 5
Thanked 4 Times in 4 Posts
smitai is on a distinguished road
Unhappy difference bet unique and distinct

Is threre any difference bet 'disinct' and 'unique' key word used in select clause
ex
select disinct(column_name) from table_name;
select unique(column_name) from table_name;
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-27-2007
Expert Member
 
Join Date: Sep 2006
Location: India
Posts: 131
Thanks: 1
Thanked 21 Times in 20 Posts
Innila is on a distinguished road
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 ***
Reply With Quote
The Following User Says Thank You to Innila For This Useful Post:
  #3 (permalink)  
Old 06-18-2007
Junior Member
 
Join Date: Jun 2007
Location: banglore
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rajeshqsoft is on a distinguished road
Smile Re: difference bet unique and distinct

UNIQUE we are inserting unique data to table
DISTINCT means we are retriving unique values from duplicate records
Reply With Quote
  #4 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Jul 2008
Location: mumbai
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
vaishalik is on a distinguished road
Re: difference bet unique and distinct

Both are same but distinct use in sql as well in oracle but unique only use for oracle
Reply With Quote
  #5 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Oct 2009
Location: India
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
tykarthick is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Certification > Oracle Certification

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to find the unique id of mails through code priya1985 Scripting 0 02-08-2007 03:30 AM
Usage of Unique Index RyanJames Oracle 2 10-13-2006 07:00 PM


All times are GMT -4. The time now is 12:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved