declare @sql varchar(8000)set @sql = 'select Name as ' + '姓名'select @sql = @sql + ' , max(case Subject when ''' + Subject + ''' then Result else 0 end) [' + Subject + ']'from (select distinct Subject from tb) as aset @sql = @sql + ' from tb group by name'exec(@sql)from (select distinct Subject from tb) as aas a必须要么。可不可以不要
- 2 回答
- 0 关注
- 1081 浏览
添加回答
举报
0/150
提交
取消