I have some data in a table in sqlite database. The table has only one column with data as JSON records.
sqlite> .schema feeds3
CREATE TABLE feeds3 (data text NOT NULL);
When I am querying from the table using json_extract
I can see the data getting fetched from the JSON path. But when I am trying to use the same json_extract in order by clause it gives me error saying malformed JSON.
sqlite> select json_extract(data,'$.ps') from feeds3 limit 1;
AA1227
sqlite> select * from feeds3 order by json_extract(data,'$.ps') limit 1;
Error: malformed JSON
The json1
module I installed is by downloading the json1.c
file from the below link :
https://sqlite.org/cgi/src/raw/ext/misc/json1.c?name=9799e4252b305edcbe659329eec3ca80ed85f968
and followed below steps
gcc -g -fPIC -dynamiclib json1.c -o json1
sqlite> .load json1
Sqlite version:sqlite-snapshot-201904101324