Database Reference
In-Depth Information
Figure 6.7
Null Values Always
Match the IS
NULL
Comparison.
Second, we can add an NVL function to convert any row with null val-
ues in the PLAYING_TIME column to some value before comparing it.
Let's make a null value equal to zero playing time. Change the WHERE
clause as shown. The resulting query will have the same result as that in Fig-
ure 6.7 where null values are converted to a literal before the comparison.
WHERE TITLE BETWEEN 'A' and 'C'
AND NVL(PLAYING_TIME,'0:00') < '4:00'
One point to note about using the NVL function is that you must use
an expression (an expression can be a literal value) that matches the
datatype of the original column. For example, the code snippet below is
invalid because the literal cannot be translated into a date. There is no such
date with a value UNKNOWN.
NVL(RECORDING_DATE,'UNKNOWN')
Now let's look at some different types of sorting methods, in addition to
sorting by single or multiple column names.
Search WWH ::




Custom Search