Database Reference
In-Depth Information
BEGIN
vSPLIT := INSTR(pTIME,':');
vHOURS := TO_NUMBER(SUBSTR(pTIME,1,vSPLIT-1));
vSECONDS := TO_NUMBER(SUBSTR(pTIME,vSPLIT+1));
RETURN vHOURS+(vSECONDS/60);
EXCEPTION WHEN OTHERS THEN
RETURN 0;
END;
/
And now we can replace the ORDER BY clause with the function as an
expression, making for a much easier to read ORDER BY clause. The result
is shown in Figure 6.9.
ORDER BY GETTIME(PLAYING_TIME) NULLS FIRST, 3 DESC, 1;
Figure 6.9
Using an
Expression in the
ORDER BY
Clause.
Search WWH ::




Custom Search