I have a SQL table with a column containing XML. It's not pretty but it is part of the project and noch changeable.
Now I need to extract a value from a specific element of this XML. Value is a federal state, so the length of the value is variable, what means that
SUBSTRING ( expression ,start , length )
is not an option, as i can't say how long my value will be.
Is there a function that allows to search between two expression, like
FOO ('state>', '</state')
or anything in that direction?
EDIT:
I'm using MySQL 5.6
Example:
<root>
<person>
<name>Michael</name>
<state>Berlin</state>
</person>
</root>
my output should be
Berlin
where a different person can have a different state and so length of value is not allways the same.
thanks for your time.