在做一个数据库移植的项目,此项目已经完工,用的数据库是SqlServer的数据库
现在要让此项目支持使用MySql数据库 ,所以就要改Sql语句
下面是一条可以在SqlServer数据库里面执行的Sql语句,
请帮我改成可以在MySql数据库下支持运行的语句------------------------------这是一个整体-----------------------------------------------------
with ProcessSpaceRecursion
(Level, ID , ParentMapID , MapName)
AS
(
SELECT 0 level, MapID , ParentMapID , MapName FROM Map T
WHERE MapID = 0
UNION ALL SELECT B.level - 1, A.MapID, A.ParentMapID, A.MapName FROM Map A, ProcessSpaceRecursion B where B.ParentMapID = A.MapID
)
insert into accessright select V.ID, R.ID,0,UserType, userno, UserName,1, '正常授权' from View_GroupAndUser V, ProcessSpaceRecursion R
where V.ID in ('1_0') and V.ID not in
(
select IdentityCode from accessright where bizobjectid = 0 and IdentityCode in ('1_0')
)
delete from AccessRight where BizObjectID=0 and BizType = 0 and IdentityCode not in ('1_0')
---------------------------------------------------------------------------------------------这是将以上语句下MySQL下执行时所报的错误
↓
---------------------------------------------------------------------------------------------
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ProcessSpaceRecursion
(Level, ID , ParentMapID , MapName)
AS
(
SELE' at line 1
------------------------------------------------------------------------------------
SQLMySQL数据库SQL Server
现在要让此项目支持使用MySql数据库 ,所以就要改Sql语句
下面是一条可以在SqlServer数据库里面执行的Sql语句,
请帮我改成可以在MySql数据库下支持运行的语句------------------------------这是一个整体-----------------------------------------------------
with ProcessSpaceRecursion
(Level, ID , ParentMapID , MapName)
AS
(
SELECT 0 level, MapID , ParentMapID , MapName FROM Map T
WHERE MapID = 0
UNION ALL SELECT B.level - 1, A.MapID, A.ParentMapID, A.MapName FROM Map A, ProcessSpaceRecursion B where B.ParentMapID = A.MapID
)
insert into accessright select V.ID, R.ID,0,UserType, userno, UserName,1, '正常授权' from View_GroupAndUser V, ProcessSpaceRecursion R
where V.ID in ('1_0') and V.ID not in
(
select IdentityCode from accessright where bizobjectid = 0 and IdentityCode in ('1_0')
)
delete from AccessRight where BizObjectID=0 and BizType = 0 and IdentityCode not in ('1_0')
---------------------------------------------------------------------------------------------这是将以上语句下MySQL下执行时所报的错误
↓
---------------------------------------------------------------------------------------------
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ProcessSpaceRecursion
(Level, ID , ParentMapID , MapName)
AS
(
SELE' at line 1
------------------------------------------------------------------------------------
SQLMySQL数据库SQL Server
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货