Hive: SELECT AS and GROUP BY

前端 未结 2 1926
情书的邮戳
情书的邮戳 2021-02-06 03:58

I have a Hive Query like

SELECT Year, Month, Day, Hours, Minutes,
           cast((cast(Seconds as int)/15) as int)*15
AS secondMod, Count(*) AS PerCount FROM L         


        
2条回答
  •  余生分开走
    2021-02-06 04:00

    Try this:

    SELECT Year, Month, Day, Hours, Minutes, 
    cast((cast(Seconds as int)/15) as int)*15 
    AS secondMod, Count(*) AS PerCount FROM LoggerTable 
     GROUP BY Year, Month, Day, Hours, Minutes, 
       cast((cast(Seconds as int)/15) as int)*15
    ORDER BY PerCount;
    

提交回复
热议问题