Hi, Sorry for asking here,but I have tried on a Sqlite forum and so far no answers.
But I know on here your are knowledgeable and some use JSON and SQlite.
I have a JSON SQLite database, at the moment I use 2 separate queries to extract the data.
What I need is to have these as one single query made from the two below ?.
The reason is that Grafana gives the Legend twice ?
select
json_extract( value, '$.Gas_reading' ) as Gas,
json_extract( value, '$.iso') as time
from DATABASE, json_tree( DATABASE.data, '$.IP15' )
where type = 'object'
and json_extract( value, '$.Gas_reading' ) >= 0;
and the other one
select
json_extract( value, '$.Electricity_reading' ) as Electricity,
json_extract( value, '$.iso') as time
from DATABASE, json_tree( DATABASE.data, '$.IP22' )
where type = 'object'
and json_extract( value, '$.Electricity_reading' ) >= 0;
If this helps ...
My Database setup
and the objects that are in the above Database DATA table.