Database Reference
In-Depth Information
Obviously, a position number cannot be applied to the expression unless
the expression is placed into the SELECT list.
Note:
Copying the expression from the ORDER BY into the SELECT col-
umns list could possibly help performance.
We can change the query something like that shown following. The
expression GETTIME(PLAYING_TIME) has been added to the query,
and the ORDER BY clause has been changed to accommodate it. The
result in Figure 6.10 shows the same sorted order on the PLAYING_TIME
column value as shown in Figure 6.9.
SELECT RECORDING_DATE, PLAYING_TIME, GETTIME(PLAYING_TIME)
, TITLE
FROM SONG
WHERE TITLE LIKE '%a%'
AND TITLE LIKE '%e%'
AND TITLE LIKE '%i%'
ORDER BY 3 NULLS FIRST, 4 DESC, 1;
Figure 6.10
ORDER BY
Clause Expressions
Cannot Use
Positions.
 
Search WWH ::




Custom Search