I can insert IoT sensor data into an Azure SQL database via an Azure Stream Analytics query,
SELECT
*
INTO
myazuredb
FROM
mystreamin
except each time a sensor sample is taken, stream analytics creates roughly about 60 messages that are all the same and inserts them into the database. I would like just 1 row for each sample to be inserted based on the Date TIMESTAMP which are all identical. My first thought was to try GROUP BY but after some reading about Stream Analytics Query Language I tried.
SELECT CollectTop(1) OVER (ORDER BY Date ASC) as Date
INTO
myazuredb
FROM
mystreamin TIMESTAMP BY Time
GROUP BY Date, TumblingWindow(second, 60)
This query doesn't insert anything, not sure I am even on the right track. Any ideas on how to approach the problem would be great. Table: Date, DeviceId, Temperature, Humidity, Moisture, EventProcessedUtcTime, PartitionId, EventEnqueuedUtcTime, IoTHub, EventID