<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      數(shù)倉(cāng)sql場(chǎng)景:求第一次出現(xiàn)和最后一次出現(xiàn)及最后一次的相關(guān)信息

      1.需求

      根據(jù)身份證號(hào)分組聚合求第一次(開(kāi)始時(shí)間最小)出現(xiàn)的基站及對(duì)應(yīng)時(shí)間和最后一次(結(jié)束時(shí)間最大)出現(xiàn)的基站,ip4,ip6及對(duì)應(yīng)時(shí)間
      

      2.應(yīng)用場(chǎng)景

      安全行業(yè),上網(wǎng)流量日志監(jiān)控行業(yè),如追擊罪犯,要查看第一次出現(xiàn)的位置和最后一次出現(xiàn)的位置及最后一次聯(lián)系人等相關(guān)信息,從而可以和最后一次聯(lián)系人及相關(guān)信息從而分析罪犯去向等信息
      

      3.示例數(shù)據(jù)

      with a as 
      (select 1 as identitycode,'st_001' as stationid,'ip4_001' as ip4,'' as ip6, 1 as isipv4,20240615150101 as starttime,20240615150601 as endtime
      union all 
      select 1 as identitycode,'st_002' as stationid,'' as ip4,'ip6_001' as ip6, 0 as isipv4,20240615150601 as starttime,20240615150901 as endtime
      union all 
      select 1 as identitycode,'st_003' as stationid,'ip4_02' as ip4,'' as ip6, 1 as isipv4,20240615151301 as starttime,20240615151701 as endtime
      union all
      select 2 as identitycode,'st_004' as stationid,'' as ip4,'ip6_004' as ip6, 0 as isipv4,20240618150101 as starttime,20240618150601 as endtime
      union all 
      select 2 as identitycode,'st_005' as stationid,'' as ip4,'ip6_001' as ip6, 0 as isipv4,20240618150601 as starttime,20240618150901 as endtime
      union all 
      select 2 as identitycode,'st_006' as stationid,'ip4_07' as ip4,'' as ip6, 1 as isipv4,20240618151301 as starttime,20240618151701 as endtime)
      

      4.sql實(shí)現(xiàn)

      hivesql實(shí)現(xiàn),在倉(cāng)內(nèi)實(shí)現(xiàn)結(jié)果直接應(yīng)用

      with a as 
      (select 1 as identitycode,'st_001' as stationid,'ip4_001' as ip4,'' as ip6, 1 as isipv4,20240615150101 as starttime,20240615150601 as endtime
      union all 
      select 1 as identitycode,'st_002' as stationid,'' as ip4,'ip6_001' as ip6, 0 as isipv4,20240615150601 as starttime,20240615150901 as endtime
      union all 
      select 1 as identitycode,'st_003' as stationid,'ip4_02' as ip4,'' as ip6, 1 as isipv4,20240615151301 as starttime,20240615151701 as endtime
      union all
      select 2 as identitycode,'st_004' as stationid,'' as ip4,'ip6_004' as ip6, 0 as isipv4,20240618150101 as starttime,20240618150601 as endtime
      union all 
      select 2 as identitycode,'st_005' as stationid,'' as ip4,'ip6_001' as ip6, 0 as isipv4,20240618150601 as starttime,20240618150901 as endtime
      union all 
      select 2 as identitycode,'st_006' as stationid,'ip4_07' as ip4,'' as ip6, 1 as isipv4,20240618151301 as starttime,20240618151701 as endtime)
      
      select b.identitycode,b.starttime as starttime,b.stationid as first_stationid,c.endtime as lasttime,c.stationid as last_stationid,c.ip4,c.ip6,c.isipv4 from 
      (select identitycode,stationid,starttime,row_number() over(PARTITION by identitycode order by starttime) srn from a) b 
      left join 
      (select identitycode,stationid,ip4,ip6,isipv4,endtime,row_number() over(PARTITION by identitycode order by endtime desc) lrn from a) c
      on b.identitycode=c.identitycode where b.srn=1 and c.lrn=1
      ;
      

      輸出結(jié)果

      olap引擎如clickhouse實(shí)現(xiàn)

      select 
      cur.identitycode AS identitycode,
      toUInt64(cur.first.2) AS firsttime,
      toUInt64(cur.last.5) AS lasttime,
      cur.first.1 AS firststationid,
      cur.last.1 AS laststationid,
      toUInt64(cur.last.2) AS ip4,
      cur.last.3 AS ip6,
      toUInt8(cur.last.4) AS isipv4
      from
      (SELECT 
      identitycode,
      any(account) as account,
      any(accounttype) as accounttype,
      argMin(tuple(stationid ,starttime),starttime) AS first,
      argMax(tuple(stationid,ip4,ip6,isipv4,endtime),endtime) AS last
      FROM dwd_identity_base_cur_hour cur 
      
      posted @ 2024-06-20 17:20  技術(shù)即藝術(shù)  閱讀(86)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 国产精品天干天干综合网| 少妇高潮水多太爽了动态图 | 国产精品免费视频不卡| 免费现黄频在线观看国产| 成av人电影在线观看| 少妇人妻精品无码专区视频| 国产在线无码精品无码| 日韩在线观看 一区二区| 国产午夜亚洲精品国产成人| 色偷偷女人的天堂亚洲网| 国产在线中文字幕精品| 亚洲国产高清aⅴ视频| 成人精品区| 玩弄漂亮少妇高潮白浆| 中文字幕99国产精品| 99RE6在线观看国产精品| 亚洲乱码中文字幕小综合| 国产99re热这里只有精品| 国产欧美亚洲精品第1页| 久久狠狠高潮亚洲精品夜色| 中文字幕亚洲资源网久久| 成人无码特黄特黄AV片在线| 日韩av在线不卡一区二区| 91亚洲国产成人精品性色| 国产一区二区三区的视频| 久久一区二区中文字幕| 波多野结衣在线播放| 国产精品无码a∨麻豆| 国产一区二区三区小说| 青青草国产线观看| 视频二区中文字幕在线| 国产欧美日韩高清在线不卡| 亚洲欧洲av一区二区久久| 亚洲av免费看一区二区| 亚洲精品理论电影在线观看 | 久久av无码精品人妻出轨| 国产高清午夜人成在线观看,| 色欲aⅴ亚洲情无码av蜜桃| 国产三级精品片| 亚洲av成人区国产精品| 国产自拍偷拍视频在线观看|