Access SQL With PIVOT

后端 未结 1 1656
悲&欢浪女
悲&欢浪女 2020-12-20 05:17

I\'m using Access and attempting to duplicate some syntax I found on MSDN. Unfortunately it seems Access is having a problem with a FROM statement in my Syntax. I\'m not sur

相关标签:
1条回答
  • 2020-12-20 06:20

    The syntax to pivot in MS Access is different from sql server. You have to use the TRANSFORM function to pivot data.

    The syntax will be similar to this:

    TRANSFORM SUM([Retention & Graduation].Hc)
    SELECT [Retention & Graduation].Year, 
      [Retention & Graduation].Status, 
      [Retention & Graduation].Hc
    FROM [Retention & Graduation]
    GROUP BY [Retention & Graduation].Year
    PIVOT [Retention & Graduation].[STATUS]
    
    0 讨论(0)
提交回复
热议问题