Last active
January 11, 2018 07:41
-
-
Save sjwaight/c20f38b739df224656d84ea778f1b7b0 to your computer and use it in GitHub Desktop.
Azure Stream Analytics Query showing how we can filter data based on arrays in reference data.
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 | |
RD.DispenserEventId AS EventId, | |
RD.DispenserNumber, | |
RD.LocationId, | |
RD.EventTimeUTC AS Timestamp | |
INTO | |
ehpartnerdata | |
FROM | |
ehrawdispenserfeed RD | |
JOIN siteandispenserlist SDL ON RD.LocationId = SDL.LocationId | |
CROSS APPLY GetArrayElements(SDL.PartnerDispensers) As SiteDispenser | |
WHERE | |
RD.EventType = 2 | |
AND | |
SiteDispenser.ArrayValue = RD.DispenserNumber |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment