SELECT DISTINCT 示例
返回 CATEGORY 表中的不同类别组的列表:
select distinct catgroup from category order by 1; catgroup ---------- Concerts Shows Sports (3 rows)
返回针对 2008 年 12 月的独特的周编号集:
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)