Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE readings (
- id int(11) NOT NULL AUTO_INCREMENT,
- value double NOT NULL,
- created_dt datetime NOT NULL,
- device_id int(11) NOT NULL,
- PRIMARY KEY (id),
- UNIQUE KEY readings_created_dt_483d31a3654ede43_uniq (created_dt,device_id),
- KEY readings_device_id_6a03c4ab761154d1_fk_device_id (device_id),
- CONSTRAINT readings_device_id_6a03c4ab761154d1_fk_device_id FOREIGN KEY (device_id) REFERENCES device (id)
- ) ENGINE=InnoDB AUTO_INCREMENT=138611438 DEFAULT CHARSET=latin1
- SELECT value, created_dt FROM readings WHERE (created_dt BETWEEN '2019-03-17 19:11:00' AND '2019-03-18 19:11:00' AND (device_id) IN (10, 11, 12));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement