Say I have a table called "xml" that stores XML files in a single column "data". How would I write a MySQL query that run an XPath and return only rows matching that XPath?
SELECT * FROM xml
WHERE EXTRACTVALUE(data, '<xpath-expr>') != '';
You should note, however, that there are limitations to MySQL's support of XPath.
EXTRACTVALUE()
returns only CDATA.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With