select * from data where sn='thermostat0' and pq='relay' order by id desc limit 4
idsntspqvaluesystemts
44804181 thermostat0 relay 0 1611071446 Tue 19 01 2021 16:50:46
44804174 thermostat0 relay 0 1611071425 Tue 19 01 2021 16:50:25
44804165 thermostat0 relay 0 1611071404 Tue 19 01 2021 16:50:04
44804154 thermostat0 relay 0 1611071383 Tue 19 01 2021 16:49:43

Tue Jan 19 16:50:56 2021 by walley