Row_Number() 超过 20 亿条记录 (Teradata) [英] Row_Number() over 2 billion records (Teradata)
问题描述
我正在使用 Teradata 仓库,并且在我的一个 sql 脚本中使用 row_number.我尝试使用我的脚本的记录集大于整数值阈值的最大值.遇到这种情况怎么办?
I am working with a Teradata warehouse, and I am using row_number in one of my sql scripts. The record set I am trying to use my script on is larger than the maximum of the integer value threshold. What to do in such a situation?
(将row_number() over (par..)"表达式转换为 bigint 不起作用)
(casting the "row_number() over (par..)" expression to bigint did not work)
如果您在另一个 DBMS 中找到了此问题的解决方案,那么我也欢迎您的解决方案,因为它也可能适用于 Teradata.
If you have found a solution for this problem in another DBMS, then I also welcome your solution as it might work in Teradata too.
推荐答案
有可能只是强制转换值.
It is possible that just casting the value would work.
如果没有,试试这个:
select sum(cast(1 as bigint)) over (order by . . . Rows Unbounded Preceding)
或者,或者,
select csum(cast(1 as bigint), <order by column here>)
这篇关于Row_Number() 超过 20 亿条记录 (Teradata)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!