0

我正在尝试将此访问查询转换为 sql 2008

任何人都可以将此访问查询转换为 sql 吗?

TRANSFORM Sum(q_INTERMONTH_Union_ILIs.Total) AS SumOfTotal
SELECT q_INTERMONTH_Union_ILIs.[Billable Identifier], 
   q_INTERMONTH_Union_ILIs.[Entity Identifier]
FROM q_INTERMONTH_Union_ILIs
GROUP BY q_INTERMONTH_Union_ILIs.[Billable Identifier], 
   q_INTERMONTH_Union_ILIs.[Entity Identifier]
PIVOT q_INTERMONTH_Union_ILIs.Period;

但是收到此错误...任何人都可以帮助

4

1 回答 1

0

您当前在 SQL Server 中的查询将与此类似:

select *
from
(
  SELECT q_INTERMONTH_Union_ILIs.[Billable Identifier], 
    q_INTERMONTH_Union_ILIs.[Entity Identifier],
    q_INTERMONTH_Union_ILIs.Period
  FROM q_INTERMONTH_Union_ILIs
) src
pivot
(
  Sum(Total)
  for Period in (yourPeriodValues go here)
) piv

在这一行:

for Period in (yourPeriodValues go here)

您将把所需的值作为括号内的列(yourPeriodValues go here)

于 2013-01-30T00:27:41.647 回答