dannychow
 DECLARE @sql VARCHAR(8000)
SET @sql = \'\'
SELECT  @sql = ISNULL(@sql + \',\', \'\') + QUOTENAME([dates]) + \'=max(case when [dates]=\' + QUOTENAME([dates], \'\'\'\') + \' then [subtotal] else 0 end)\'
FROM    [V_ALL_Performance]
GROUP BY [dates]
--print @sql
EXEC(\'select [thisuser]\'+@sql+\' from [V_ALL_Performance] group by [thisuser]\')

 

分类:

技术点:

相关文章:

  • 2021-09-09
  • 2021-08-04
  • 2022-12-23
  • 2021-12-29
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2021-07-18
  • 2021-12-19
  • 2021-10-18
  • 2021-11-01
  • 2021-11-13
相关资源
相似解决方案