小白问个问题:外联库中查询到的记录怎么以JSON返回到活字格中,然后导入到el表格中,查询如下(从网上找的):
declare @sql varchar(8000)
set @sql = 'select Date'
select @sql = @sql + ',isnull (sum(case item when '''+item+''' then saleqty end),0) as ['+item+']'
from (select distinct item from test) as a
select @sql = @sql+' from test group by date'
exec(@sql)
|