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上面这个sql 是sqlserver的 ,大家可以帮我把它转换到oracle 上吗

解决方案 »

  1.   

    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 -- 就是变量名字弄一下就可以了嘛!
    -- 书不要读死啦!
      

  2.   

        and a.ParentID=:ParentID order by a.id asc  这样就可以了吗