oracle SELECT DISTINCT 和 SELECT UNIQUE 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6772451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between SELECT DISTINCT and SELECT UNIQUE
提问by Pinaki
Possible Duplicate:
Unique vs distinct multi-column in Oracle 9i
可能的重复:
Oracle 9i 中的唯一与不同的多列
Proper difference between SELECT DISTINCT and SELECT UNIQUE with points and examples.
SELECT DISTINCT 和 SELECT UNIQUE 之间的正确区别与要点和示例。
回答by powerMicha
SELECT DISTINCT
and SELECT UNIQUE
behave the same way in oracle.
SELECT DISTINCT
并且SELECT UNIQUE
在 oracle 中的行为方式相同。
While DISTINCT
is ANSI SQL standard, UNIQUE
is an Oracle specific statement.
whileDISTINCT
是ANSI SQL 标准,UNIQUE
是Oracle 特定的语句。
Look here: http://psoug.org/definition/DISTINCT.htm
回答by Edgar Velasquez Lim
Oracle official documentation
甲骨文官方文档
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#sthref9346
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#sthref9346
States that:
指出:
DISTINCT | UNIQUE
独特 | 独特的
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.
如果您希望数据库仅返回所选的每组重复行的一个副本,请指定 DISTINCT 或 UNIQUE。这两个关键字是同义词。重复行是那些与选择列表中的每个表达式具有匹配值的行。