How to enter configuration mode on sensor
[eg5120] / nl_new.sql
1
2 create temporary table nl_received as select _id,json->'received' as received from nodelog where json->'received' is not null;
3
4 create temporary table eg_received as select _id,json->'received' as received from eg5120 where json->'received' is not null;
5
6 select count(*) from nl_received where received not in (select received from eg_received) ;
7
8 create temporary table nl_new as select * from nl_received where received not in (select received from eg_received) ;
9
10 select to_timestamp((json->>'received')::int8/1000), time,mac,addr,"nodeId",json,_id,sensor_type from nodelog where _id in (select _id from nl_new);
11
12 select count(*) from nl_new ;
13
14 begin;
15
16 insert into eg5120 select to_timestamp((json->>'received')::int8/1000) as time,mac,addr,"nodeId",json,sensor_type from nodelog where _id in (select _id from nl_new);
17