In some situations,
can transform the statement internally into one that contains only one of these
keywords. The requirements are as follows:
- The columns in the ORDER BY list must be a subset of the columns in the
SELECT list.
- All the columns in the ORDER BY list are sorted in ascending order.
A unique index is not required.
For example,
SELECT DISTINCT miles, meal
FROM Flights
ORDER BY meal
is transformed into
SELECT DISTINCT miles, meal
FROM Flights
Note that these are not equivalent functions; this is simply an internal
transformation.