![]() In SQL, the DISTINCT keyword is used directly in the
SELECT statement. Take a look at Example 8, which shows
how to use the DISTINCT keyword.
Example 8
Suppose you want to display the unique prices stored in the
Price column in the Toys table in Figure 4-3. Take a look at the
following script:
SELECT DISTINCT Price
FROM Toys;
This script places the DISTINCT keyword before the Price col-
umn. This causes the DBMS to display only the unique values
in the Price column. Figure 4-17 shows the unique values in
the Price column.
62
Chapter 4
4
Figure 4-16
|
|