Monday, August 16, 2010

Oracle 11g: Nesting Functions

===>  SQL Queries (Concat,Substr,Upper)

select last_name,
       upper(concat(substr(last_name,1,8),'_US'))
from employees
where department_id=60


Results:
LAST_NAME                 UPPER(CONCAT(SUBSTR(LAST_NAME,1,8),'_US'))
------------------------- ------------------------------------------
Hunold                    HUNOLD_US                                 
Ernst                     ERNST_US                                  
Austin                    AUSTIN_US                                 
Pataballa                 PATABALL_US                               
Lorentz                   LORENTZ_US                                

5 rows selected

No comments: