How can I get the character at position 4 in a field?
e.g.
field contents = "hello"
I want to return the value of position 2 = "l"
How can I get the character at position 4 in a field?
e.g.
field contents = "hello"
I want to return the value of position 2 = "l"
In sql server you can use SUBSTRING
SELECT SUBSTRING('hello',3,1)
edit: this is not zero based.
In Oracle, use SUBSTR
Syntax is SUBSTR(<string to parse>,<start position>,(<length>))
- i.e.
SELECT SUBSTR('hello',3,1)
Start position and length are one-, not zero-based. Zero is accepted, but will be interpreted as 1.