Result tables from SELECT statements can contain duplicate rows. You can use the DISTINCT keyword to eliminate the duplicates. For example, the following command returns many duplicate rows:
SELECT city, state FROM Employees
To list only unique combinations of city and state, use this command:
SELECT DISTINCT city, state FROM Employees
The ROLLUP and CUBE operators do not support the DISTINCT keyword.
This chapter provides an overview of single-table SELECT statements. For more information about single-table SELECT statements, see
Chapter 5, “Working with Database Objects,” in the System Administration Guide: Volume 1
Chapter 2, “SQL Language Elements,” in Reference: Building Blocks, Tables, and Procedures
“SELECT statement” in Chapter 1, “SQL Statements,” in Reference: Statements and Options
Advanced uses of the SELECT statement are described in the next chapter.