P
pclogic
Unregistered / Unconfirmed
GUEST, unregistred user!
谁有最简单的交叉表例子?帮帮忙!(最好是for reportbuilder的)
由于在reportbuilder中不会做交叉表,想SQL语句完成,可是在ORACLE下执行不了:(
谁帮我改下下面的语句让其可以在ORACLE中执行!
declare @sql varchar(8000)
set @sql = 'select style_mode,panel_cd,'
select @sql = @sql + 'sum(case breadth when '''+breadth+'''
then
pcs_unit else
null end) as '''+breadth+''','
from (select distinct breadth from mrpss10w10) as a
select @sql = left(@sql,len(@sql)-1) + ' from mrpss10w10 group by style_mode,panel_cd'
exec(@sql)
由于在reportbuilder中不会做交叉表,想SQL语句完成,可是在ORACLE下执行不了:(
谁帮我改下下面的语句让其可以在ORACLE中执行!
declare @sql varchar(8000)
set @sql = 'select style_mode,panel_cd,'
select @sql = @sql + 'sum(case breadth when '''+breadth+'''
then
pcs_unit else
null end) as '''+breadth+''','
from (select distinct breadth from mrpss10w10) as a
select @sql = left(@sql,len(@sql)-1) + ' from mrpss10w10 group by style_mode,panel_cd'
exec(@sql)