SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual—523725-004
9-106
Examples of POSITION
Examples of POSITION
•
This function returns the value 8 for the position of the substring ‘John’ within the
string:
POSITION ('John' IN 'Robert John Smith')
•
Suppose that the EMPLOYEE table has an EMPNAME column that contains both
the first and last names. Return all records in table EMPLOYEE that contain the
substring 'Smith' regardless of whether the column value is in uppercase or
lowercase characters:
SELECT * FROM persnl.employee
WHERE POSITION ('SMITH' IN UPSHIFT(empname)) > 0 ;