Tuesday, September 29, 2009

Nesting Functions

SELECT ename, UPPER(SUBSTR (ENAME, 1, 8) || '_US') FROM emp WHERE deptno = 10;
The slide example displays the last names of employees in department 10.

The evaluation of the SQL statement involves three steps:

  • – The inner function retrieves the first eight characters of the last name.
  • Result1 = SUBSTR (ENAME, 1, 8)
  • – The outer function concatenates the result with _US.
  • Result2 = Result1 || '_US'
  • – The outermost function converts the results to uppercase.

No comments:

Post a Comment

Followers