POSITION returns a value according to the following rules.
Situation | Result |
---|---|
Either argument is NULL. | NULL. |
string_expression_1 has length zero, | One. |
string_expression_1 is a substring within string_expression_2. | Position in string_expression_2 where string_expression_1 starts. |
None of the preceding is true. | Zero. |
If the arguments are character types, then regardless of the server character set, the value for POSITION represents the position of a logical character, not a byte position.