Created
March 15, 2021 16:09
-
-
Save sethdorris/7c4645063c8f0ff71b41889aa4beff05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT_BIG(t1.Id) FROM dbo.Triggers AS t1 | |
JOIN dbo.Triggers AS t2 | |
ON ( | |
t1.Id < t2.Id | |
AND | |
DATEDIFF(MINUTE, t1.TriggerStart, t2.TriggerStart) <= 2 | |
AND | |
t1.DeviceId != t2.DeviceId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment