Reputation: 283
Hopefully a quick one.
How do I join a table on a DateTime metric in SQL where I want the left table to be within 30 seconds of the right Table or equal to it?
Thanks
Upvotes: 0
Views: 74
Reputation: 426
SELECT *
FROM TableA
INNER JOIN TableB on (a.Value = b.Value or a.Value = dateadd(second,30,b.Value))
Upvotes: 2