2016-07-18 16 views

Antwort

3

Dies wird den kürzesten Weg, um Ihre Abfrage zu schreiben:

SELECT 
    t, v, fqn 
FROM 
    [finalallinput] timestamp by t 
WHERE 
    IsFirst(minute, 1) OVER (WHEN [fqn] not like '%Production%') = 1 

Sie können aber auch das Gleiche tun mit TopOne Aggregatfunktion:

WITH step1 AS 
(
SELECT 
    TopOne() OVER (ORDER BY t ASC) firstEvent, 
    fqn, min(t) as timeslot 
FROM 
    [finalallinput] timestamp by t 
WHERE 
    fqn not like '%Production%' 
GROUP BY 
    TumblingWindow(minute, 1),fqn 
) 

SELECT 
    firstEvent.v, 
    fqn, 
    timeSlot 
INTO 
[finalalloutput] 
FROM step1