Skip to content

Instantly share code, notes, and snippets.

@sjwaight

sjwaight/asa-query.sql

Last active Jan 11, 2018
Embed
What would you like to do?
Azure Stream Analytics Query showing how we can filter data based on arrays in reference data.
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
You can’t perform that action at this time.