I have a column in sqlite which stores a column with json files and the the key of the json can contain any unicode characters. I have a query to calculate the cardinality of the specific key.
SELECT COUNT(DISTINCT JSON_UNQUOTE(JSON_EXTRACT(dimensions, '$.*abc')))from `definition`
the name is *abc which contains a special character * and used in the json path to the value of the json. the query returns nothing.
In order to read special characters like *
, the json path is double-quoted and the above query becomes
SELECT COUNT(DISTINCT JSON_UNQUOTE(JSON_EXTRACT(dimensions, '$."*abc"')))from `definition`
Now I am able to read json path with *
but unable to read json path containing a double quote, for example
SELECT COUNT(DISTINCT JSON_UNQUOTE(JSON_EXTRACT(dimensions, '$."a"bc"')))from `definition`
I tried to escape the double quotes in the json path with backslash or one additional double quote but it's not working. Any suggestion would be appreciated.