Oracle中的Unique vs Distinct关键字 [英] Unique vs Distinct keyword in Oracle

查看:215
本文介绍了Oracle中的Unique vs Distinct关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这些词的用法有些困惑.我有一张桌子,他下面的几列:SITE,LAT,LONG,NAME,......

I am a bit confused about the uses of these words. I have a table with he following columns: SITE, LAT, LONG, NAME, ......

我想要具有唯一(或与众不同)LAT,LONG的结果. 我该如何实现?

I want results with unique (or is it distinct) LAT, LONG. How do I achieve this?

推荐答案

select unique colA, colB from atable

select distinct colA, colB from atable

在这种情况下,唯一和独特意味着同一件事.

In this context, unique and distinct mean the same thing.

然而,不同的是ANSI标准,而独特的不是.

Distinct however is ANSI standard, whereas unique is not.

请注意,在其他区域(例如索引创建等)中使用时,唯一性还有许多其他含义.

Please note that unique has many other meanings when used in other area's ie index creation etc.

这篇关于Oracle中的Unique vs Distinct关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆