Hive - 仅按日期时间列分组

时间:2017-03-27 04:04:00

标签: sql amazon-web-services group-by presto amazon-athena

在我的表中,eventtime列看起来像是

char pop(stack *s){
    if(s == NULL){
        isEmpty(s);
        return -1;
    }
    char x=s->value;
    s=(s->next);
    return x;
}

我想按事件时间分组,仅限日期。

喜欢

2017-03-25T03:18:00001Z
2017-03-25T05:21:00013Z

2 个答案:

答案 0 :(得分:1)

GROUP BYSELECT子句中使用它。

cast (from_iso8601_timestamp(eventtime) as date) 

答案 1 :(得分:0)

GROUP BY CAST(myDateTime AS DATE)