代码之家  ›  专栏  ›  技术社区  ›  Will

ssrs-特定列的值数

  •  0
  • Will  · 技术社区  · 7 年前

    我有一张表显示两个字段:

    Location      Status
    
    Location1     Current 
    Location2     Current
    Location3     Not Active
    Location4     Not Active
    Location5     Current
    

    我想在我的报告中添加一个单独的表格来汇总数据:

    Status    Number of Partners
    
    Current           3
    Not Active        2
    

    这在visual studio中是否可能,或者我是否应该考虑用sql来实现(这会更容易,但只是有点兴趣)。

    提前谢谢你的帮助。

    2 回复  |  直到 7 年前
        1
  •  1
  •   Amrita Srivastava    7 年前

    是的,您可以创建一个单独的表…但是它可以在同一个表中通过只添加一个查询组来完成。

        select status, count(status) from table t group by status;
    
        2
  •  0
  •   Yogesh Sharma    7 年前

    为什么是分开的桌子?你可以做到:

    select status, count(*)
    fro table t
    group by status;