I have two tables ‘poolTemp’ and ‘weather’. Both tables contain the columns “timeStamp” and “tempC”. I want to join the tables with both “tempC” but only when poolTime.timeStamp is within 5 minutes of weather.timeStamp
poolTemp.timeStamp data is recorded up to every 5 minutes, weather.timeStamp is recorded every 15 minutes.
I have the following so far, but it is not exactly returning matches…
SELECT DISTINCT poolTemp.time, poolTemp.tempC FROM poolTemp LEFT JOIN weather ON TIMESTAMPDIFF(MINUTE,weather.time, poolTemp.time) < 15
I am expecting to see a table with only timestamps that are within 15 minutes of each other but I see all of the timestamps from poolTemp (a temp reading every 5 minutes).
Thanks