我想将行值查询为SQL中的列

发布于 2025-01-29 06:20:18 字数 178 浏览 4 评论 0原文

我有一个查询以从db

​=“ nofollow noreferrer”> “在此处输入图像描述”

有什么办法可以做到这一点? 我该怎么做?真的很困

I have a query to result in the below data from DB

enter image description here

But actually, I want to get the data as

enter image description here

Is there any way we can do this the SSRS?
How can I do this? really stuck

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沧笙踏歌 2025-02-05 06:20:18

您可以在不更改数据集的情况下轻松地在SSR中执行此操作。

  1. 将矩阵控件添加到您的报告中,
  2. 将受让人字段拖动到占位符占位
  3. 符priortity_n字段到占位符占位符
  4. 将count_c字段拖动到data占位

符。如果这没有帮助,请告诉我,我将使用示例图像进行更新。

You can do this easily in SSRS without changing your dataset.

  1. Add a Matrix control to your report
  2. Drag the Assignee field to the Rows placeholder
  3. Drag the Priority_n field to the Columns placeholder
  4. Drag the Count_C field to the Data placeholder

that's it. If this does not help, let me know and I will update with sample images.

不必你懂 2025-02-05 06:20:18

请重新检查列名;

SELECT * FROM (
  SELECT
    [Assignee],
    [Priority_n],
    [Count_C]
  FROM dataset
) Results
PIVOT (
  SUM([Count_C])
  FOR [Priority_n]
  IN (
    [High],
    [Medium],
    [Low]
  )
) AS PivotTable

Please recheck the column names;

SELECT * FROM (
  SELECT
    [Assignee],
    [Priority_n],
    [Count_C]
  FROM dataset
) Results
PIVOT (
  SUM([Count_C])
  FOR [Priority_n]
  IN (
    [High],
    [Medium],
    [Low]
  )
) AS PivotTable
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文