select 商品, 部门A = sum(case 部门 when '部门A' then 数量 else 0 end), 部门B = sum(case 部门 when '部门B' then 数量 else 0 end), 部门C = sum(case 部门 when '部门C' then 数量 else 0 end) from B group by 商品 ———————————————————————————— ACCESS中的交叉表的确与SQL中的不一样,楼主可以参考MSSQL帮助中的交叉表中的描述。解决应该没有问题。
商品,
部门A = sum(case 部门 when '部门A' then 数量 else 0 end),
部门B = sum(case 部门 when '部门B' then 数量 else 0 end),
部门C = sum(case 部门 when '部门C' then 数量 else 0 end)
from
B
group by
商品
————————————————————————————
ACCESS中的交叉表的确与SQL中的不一样,楼主可以参考MSSQL帮助中的交叉表中的描述。解决应该没有问题。