Comments - JSON_TABLE

1 year, 3 months ago Mathieu Géhin

It seems JSON_TABLE does not unquote JSON strings when producing a VARCHAR column.

You can achieve this using the JSON type for the column and explicitly unquoting using JSON_UNQUOTE :

SELECT JSON_UNQUOTE(text) FROM JSON_TABLE( '[{"text":"The book''s title is \\"Lord of the Rings\\""}]', '$[*]' COLUMNS ( `text` JSON PATH '$.text' ) ) AS st

Result :

The book's title is "Lord of the Rings"
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.