Nest String Functions

You can nest string functions. For example, use the substring function to display the last name and the first initial of each author, with a comma after the last name and a period after the first name.

Enter:
select (au_lname + "," + " " + substring(au_fname, 1, 1) + ".") 
from authors 
where city = "Oakland" 
-------------------------------------------- 
Green, M. 
Straight, D. 
Stringer, D. 
MacFeather, S. 
Karsen, L. 

To display the pub_id and the first two characters of each title_id for books priced more than $20, enter:

select substring(pub_id + title_id, 1, 6) 
from titles 
where price > $20 
-------------- 
1389PC 
0877PS 
0877TC