JSON Sqlite database query .. 2 into 1?

Hi, Sorry for asking here,but I have tried on a Sqlite forum and so far no answers. :pensive:
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 ?
04


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
03

and the objects that are in the above Database DATA table.

I finally found out the answer, so just in case anyone else has this problem ...

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.