ms sql到oracle sql的转换
请大家帮帮忙,把下面的sql语句转换成能在oracle下面跑的,此语句在ms sql server下编译无误,请大家帮个忙,急,在线等,万分感谢!declare @sql varchar(8000)
set @sql = 'select (case when grouping(t2.itemname)=1 then ''总计'' else t2.itemname end) as itemname,'
select @sql = @sql+ ' sum(case when TRANSACTID= '+TRANSACTID+' then 1 else 0 end) as ['+TRANSACTID+'],'
From (Select Distinct TRANSACTID From C_ACCEPT_STATUS) T
set @sql = left(@sql,len(@sql)-1)+',(case when count(1)=0 then ''0'' else count(*) end) as ''总计''
from WORKAPPLY t left join C_ADMIN_ITEM t2
on t.itemid=t2.itemcode group by t2.itemname with rollup'
exec(@sql)