-1
我找一年的枢轴数据与MS SQL SERVER透视表
select month(createdatetime) as month,
year(createdatetime) as year,
count(*) as members
from [toneexcel].[dbo].[teUserMemberSIMAcc]
where year(createdatetime) > '2015' and status = 'AC'
group by month(createdatetime), year(createdatetime)
order by year(createdatetime), month(createdatetime)
请建议我这下面的查询,TQ
电流输出
Month| year | members
-----------------------
1 2016 12914
2 2016 13338
3 2016 13633
4 2016 11110
5 2016 9868
6 2016 7088
7 2016 6785
8 2016 8260
9 2016 8386
10 2016 8506
11 2016 7187
12 2016 7976
1 2017 8535
2 2017 12744
3 2017 579
预期输出为
Month | 2016 | 2017
----------------------
1 12914 | 8535
2 13338 12744
3 13633 579
4 11110
5 9868
6 7088
7 6785
8 8260
9 8386
10 8506
11 7187
12 7976
请出示样品的数据和预期的输出。 –
提供一些示例数据。 –
@madhan发布问题本身的数据,而不是评论。你发布的内容无济于事 - 它只是一行数字。你想每年有一行,每月一次,是什么? *更新*有关信息的问题。我会为你做,但我不知道数据应该看起来像 –