Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Freezer | Timestamp | Temperature_1
- 1 2018-04-25 09:45:00 10
- 1 2018-04-25 09:50:00 11
- 1 2018-04-25 09:55:00 11
- Freezer | Timestamp | Temperature_2
- 1 2018-04-25 09:46:00 15
- 1 2018-04-25 09:52:00 13
- 1 2018-04-25 09:59:00 12
- Freezer | Timestamp | Temperature_1 | Temperature_2
- 1 2018-04-25 09:45:00 10 15
- 1 2018-04-25 09:50:00 11 13
- 1 2018-04-25 09:55:00 11 12
- SELECT A.Freezer, A.Timestamp, Temperature_1,Temperature_2 From TABLE_A as A
- RIGHT JOIN TABLE_B as B
- ON A.FREEZER = B.FREEZER
- WHERE A.Timestamp = B.Timestamp (this of course doesn't work because timestamps aren't the same)
- SELECT Temperature_1
- From TABLE_A A JOIN
- TABLE_B B
- ON A.FREEZER = B.FREEZER AND
- A.Timestamp >= DATEADD(minute, -5, B.TimeStamp) AND
- A.Timestamp <= DATEADD(minute, 5, B.TimeStamp) ;
Add Comment
Please, Sign In to add comment