--try: declare @sql1 varchar(8000) set @sql1='' select @sql1=@sql1+'max(case when PicTitle='''+PicTitle+''' then PicUrl else 0 end) as ['+PicTitle+']' from Attachment group by PicTitle set @sql1='select'+@sql1+' from Attachment group by PicTitle' exec(@sql1)
- 1 回答
- 0 关注
- 1072 浏览
添加回答
举报
0/150
提交
取消