以下是引用Bin在2013-4-27 9:46:00的发言:
select [姓名], count(case when [类别]='语文' then 1 end) as 语文,
count(case when [类别]='数学' then 1 end) as 数学,
count(case when [类别]='英语' then 1 end) as 英语,
count(case when [类别]='化学' then 1 end) as 化学
from {表A} group by [姓名]
Select [姓名], count(Case when [类别]='语文' then 1 end) as 语文,count(Case when [类别]='数学' then 1 end) as 数学,count(Case when [类别]='英语' then 1 end) as 英语,count(Case when [类别]='化学' then 1 end) as 化学 from {表A} group by [姓名]
这个语句foxtable不能执行,提示IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败。