本文介绍了在子查询中聚合按位或的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
给定下表:
是否可以为子查询中的所有行计算n
的按位或??例如,如果 BitValues 包含这 4 行:
我希望子查询返回 7.有没有办法在不创建 UDF 的情况下内联执行此操作?
解决方案
Given the following table:
Is it possible to compute the bitwise-OR of n
for all rows within a subquery? For example, if BitValues contains these 4 rows:
+---+ | n | +---+ | 1 | | 2 | | 4 | | 3 | +---+
I would expect the subquery to return 7. Is there a way to do this inline, without creating a UDF?
解决方案
这篇关于在子查询中聚合按位或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!