Database Reference
In-Depth Information
Figure 9.12
The DECODE
Function Is Useful
for Short Lists of
Values.
from the beginning of the NAME column, up to the space character. The
first two columns in the query are included to show the values being
worked with, helping understand what the combination of the two func-
tions returns Figure 9.13 shows the result.
SELECT NAME, INSTR(NAME,' ')
, SUBSTR(NAME,1,INSTR(NAME,' ')) FIRSTNAME
FROM ARTIST;
Now let's find the last name, once again using the INSTR and SUBSTR
functions. The result is shown in Figure 9.14.
COLUMN LASTNAME FORMAT A20
 
Search WWH ::




Custom Search