本文介绍了在 SSRS 中替换 OVER 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 SSRS 2008 中实现 OVER() 命令?

How can I implement the OVER() command in SSRS 2008?

有什么技巧吗,还是我卡住了?

Is there a trick to it, or am I stuck?

如果我确实无法使用 OVER(),那么如何在 SSRS 报告中使用 PARTITION?

And if I am indeed not able to use OVER(), then how can I use PARTITION in a SSRS report?

OVER() 满足我的要求,并且 Telerian(另一位成员)指出它非常有帮助 - 但 SSRS 似乎无法将其用于报告.

OVER() satisfies my requirements, and Telerian (another member) was very helpful by pointing it out - but SSRS doesn't seem to be able to use it for reporting.

每次我在 SSRS SELECT 语句中使用 OVER() 或 PARTITION 的变体时,我都会被系统拒绝 - 有什么想法或解决方法吗?

Every time I use a variant of OVER() or PARTITION in the SSRS SELECT statement, I get rebuffed by the system - any thoughts or work-arounds?

我从 2008 Query Studio 收到的错误消息是:

The error message that I was receiving from the 2008 Query Studio was:

The OVER SQL construct or statement is not supported.

推荐答案

这可能是因为没有包含汇总列的列别名 - 以下 SQL 在 SSRS 中为我​​生成了一个可用的数据集:

This may be due to not including a column alias for the summarised column - the following SQL generates a usable dataset for me in SSRS:

select d.*, 
       ROW_NUMBER() over (partition by date order by id) rn 
from dbo.myTable d

这篇关于在 SSRS 中替换 OVER 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 15:38