select device_no,data_time,so2_value,co_value,no2_value,pm10_value,pm25_value,o3_1h_value,o3_8h_value,tvoc_value
from default.zjk_air_quality_device_hourly_data
where (device_no,data_time) in (select device_no,max(data_time)
from default.zjk_air_quality_device_hourly_data
where device_class in (1,2,6,8,9) group by device_no);
SELECT device_no, grid_code, device_longitude, device_latitude, calculate_time, forecast_time, forecast_count
FROM default.alg_camera_person_forecast_hourly_data
WHERE (device_no,forecast_time,calculate_time) IN (SELECT device_no,forecast_time,max(calculate_time)
FROM default.alg_camera_person_forecast_hourly_data
WHERE forecast_time >='2021-09-05 00:00:00' AND forecast_time <'2021-09-06 00:00:00'
GROUP BY device_no,forecast_time);