azure流分析将数据同时组合在一起

时间:2017-05-18 07:02:17

标签: sql azure stream analytics azure-stream-analytics

我正在使用azure流分析查询语言,我在数据准备方面遇到了一些问题。this is my current output

但我想同时合并数据 例如在第一行 {" 46027020","#A83"," 2017-05-18T08:47:26.5620000Z"} 标题" IGEF_NR"," Decklack"和"时间" 第二行:{" 46027070","#475"," 2017-05-18T08:49:20.1750000Z"}

1 个答案:

答案 0 :(得分:0)

您需要将过滤器子查询拆分为" IGEF_NR"和" DECKLACK",然后加入两个。如下所示:

filter_IGEF AS
(
  SELECT sub_id, value,time
  FROM stringfilter
  WHERE sub_id = 'IGEF_Nr'
 ),

 filter_Decklack AS
(
  SELECT sub_id, value,time
  FROM stringfilter
  WHERE sub_id = 'Decklack'
 ),

 joined_value AS
 (
   SELECT
     i.value AS IGEF_Nr,
     d.value AS Decklack,
     i.time as time
   FROM filter_IGEF i
   JOIN filter_Decklack d
   ON i.time = d.time
   AND DATEDIFF(second, i, d) BETWEEN 0 AND 5
 )

 SELECT IGEF_Nr, Decklack, time
 INTO csv
 FROM joined_value