I have the following query:
select position( '/s/' in col)
from table
This works.
Now, I want to be able to find the position of /s/ or /d/ or /c/
I tried:
select position( '[/s/][/c/][/d/]' in col)
from table
But it returns a wrong value.
Example:
select position( '/s/' in '/s/')
returns 1.
select position( '[/s/][/d/][/c/]' in '/s/')
returns 0
How can I solve this?
Edit:
It can contains only one of
/s/or/d/or/c/. The string will not contain/s/d/etc...There can't be more the one occurrences of the matched sub-string. The string won't contain
'/s/..../s/'
In simple words - I'm looking for the first occurrence of /s/ or /d/ or /c/ don't worry about the edge cases.
colcontains both/s/and/d/? Does it matter which position to return if there are multiple matches?position('/s/|/d/|/c/' in '/s/').