如下的sql 语句是针对sqlserver 的 ,转到oracle ,需要改 吗,如果需要该怎么改啊
select a.id,SiteName,RuleID from Collect_Site a left outer join Collect_RuleApply b on a.ID = b.SiteID where a.ChannelID=10;
select a.id,a.channelName,a.ParentID,(select count(id) from sys_channel b where b.islock=0 and b.ParentID=a.id) as hashCount from sys_channel a where a.islock=0 and a.ParentID=@ParentID order by a.id asc
select a.*,(select count(id) from sys_channel b where b.islock=0 and b.isConstr=1 and b.ParentID=a.ID) as HashCount from sys_channel a where a.islock=0 and a.isConstr=1 and a.ParentID=@ParentID order by a.id asc
select a.id,SiteName,RuleID from Collect_Site a left outer join Collect_RuleApply b on a.ID = b.SiteID where a.ChannelID=10;
select a.id,a.channelName,a.ParentID,(select count(id) from sys_channel b where b.islock=0 and b.ParentID=a.id) as hashCount from sys_channel a where a.islock=0 and a.ParentID=@ParentID order by a.id asc
select a.*,(select count(id) from sys_channel b where b.islock=0 and b.isConstr=1 and b.ParentID=a.ID) as HashCount from sys_channel a where a.islock=0 and a.isConstr=1 and a.ParentID=@ParentID order by a.id asc
变量不能写id=id 这个就相当于没有where条件了,所以注意变量名不要和字段名重复。