SQL语句转换问题
要从 SQLSERVER转到 ORACLE 求助!!
insert into #tmp(moduleid,moduleName,parentid,selected,[levelpath]) select ModuleID,ModuleName= case isnull(level, ' ') when '2 ' then '++ '+ModuleName when '3 ' then '+++ '+ModuleName when '4 ' then '++++ '+ModuleName else ModuleName end,ParentID,1 'selected ',[levelpath] from cqut_CMS_Module where ModuleID =@mModuleID
------解决方案--------------------insert into table_tmp(moduleid,moduleName,parentid,selected,levelpath)
select ModuleID,ModuleName= case level when '2 ' then '++ '|| ModuleName
when '3 ' then '+++ '||ModuleName
when '4 ' then '++++ '||ModuleName
else ModuleName end,
ParentID, '1 '|| 'selected ',levelpath
from cqut_CMS_Module where ModuleID =mModuleID
--oracle中连接用||,变量不用@
1 'selected ' 这个地方没看懂 是字符串么,
如果时代单引号的字符串 ,单引号要变成2个单引号
sql server中 select 1 'selected ' ,列为selected,内容是 1