时间查询
1.influxdb数据库存储数据的时间和存入的时间戳时间相差8小时,所以应该将时间戳加8小时后再存入数据库
2.利用时间作为条件查询时需要用UTC时间进行查询,并且时间需要用单引号,示例如下:
select * from environment_monitor_sensor where time >= '2023-07-07T13:50:00Z' order by time desc
条件查询
1.使用条件查询时条件的值需要用单引号引起来,示例如下:
select * from environment_monitor_sensor where devEUI = '24e124136d028051' and time >= '2023-07-07T13:50:00Z' and time <= '2023-07-07T13:51:00Z' order by time desc