HI SQL Gurus. I have two tables.
Table A (timestamp, event)
Table B (Timestamp, val1, val2, val3)
I need to join these two tables on time stamp but the catch is that while joining, I have to aggregate the val1,2 and 3 during a widow of +4 second and -4 seconds.
e.g. if the time stamp in A is 12:32:10:0000, so this value upto second is used for the join and the window to join to table B would be 12:32:10 + 4 seconds and 12:32:10-4 seconds. its like joining one value from A to upto 8 values in B and then taking the aggregate of the values in B and displaying them as
12:32:10:0000 | AVG(val1) | AVG(val2) | AVG(val3)
Any help would be appreciated.