Amazon Redshift
数据库开发人员指南 (API Version 2012-12-01)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

SELECT DISTINCT 示例

返回 CATEGORY 表中的不同类别组的列表:

Copy
select distinct catgroup from category order by 1; catgroup ---------- Concerts Shows Sports (3 rows)

返回针对 2008 年 12 月的独特的周编号集:

Copy
select distinct week, month, year from date where month='DEC' and year=2008 order by 1, 2, 3; week | month | year -----+-------+------ 49 | DEC | 2008 50 | DEC | 2008 51 | DEC | 2008 52 | DEC | 2008 53 | DEC | 2008 (5 rows)