hql 查找非group by字段

1.取得非group by 字段
 select COLLECT_LIST(event) , uuid from stat_event group by uuid;
 
2.得到事件流(自定义事件处理)
select cid, uuid, account, concat_ws(',', COLLECT_LIST(cast (event AS string) ) ), concat_ws(',', COLLECT_LIST(cast (timestamp AS string) ) ) from stat_event where year = 2015 and month = 1 and day = 5 group by cid, uuid, account;
 
总结:
COLLECT_LIST(event):会得到一个 完整的 事件序列(未排序的)
COLLECT_SET(event):会得到一个  去重的 事件序列 (未排序的)
concat_ws(',' ,  COLLECT_LIST(cast (event AS string) ) )  :事件按照逗号分隔,组成一个事件流字符串
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值