This is an old revision of the document!
The POSITION function finds the position of a search_string in a target_string.
If the target_string is of length zero, the result is 1.
If the search_string occurs as a substring within the target_string, the character position where the search_string first occurs is returned. If neither of these conditions is true, the result is 0.
The return data type is a 4-byte INTEGER.
String comparisons are case-sensitive. Use the UPPER and LOWER functions around the search_string and the target_string to produce a case-insensitive search.
POSITION( search_string IN target_string)
Any valid text string enclosed in single quotes or a column_spec or an expression such as a function that resolves to a text string. The search_string is the string of interest that is being search for in the target_string.
Required.
Any column_spec or valid text string enclosed in single quotes or an expression such as a function that resolves to a text string. The target_string in which to search for the occurance of the search_string.
SELECT company, POSITION(UPPER('sys') IN UPPER(customers.company)) FROM customers WHERE company='systems' Company POSITION -------- --------------- Camco Systems 7 SoftSys Corp 5