Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the difference between Distinct and Unique?  RSS feed

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between Distinct and Unique?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In what context ?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And for which database?
 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using it in projection to filter out duplicate results, then probably nothing. Some databases actually only support one of them (some support both), so this is more of a syntax issue than anything else.

Otherwise, UNIQUE can also be an attribute for a column making it a candidate/primary key, whereas DISTINCT is only used in SELECT statements.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!