--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)
qq_遁去的一_1
相关分类