Loading

oracle not in 改为 not exist

 

修改前

SELECT pageID, permissionID FROM tableA
        WHERE userID=#{userID} AND projectCode=#{projectCode} AND PERMISSIONID >= 'XXXXXXX' 
        and pageID not in (select pageid from tableB WHERE OPID=#{userID} and project= #{projectCode})

 

修改后

SELECT pageID, permissionID FROM tableA
WHERE userID='XXXXX' AND projectCode='XXXXX' AND PERMISSIONID >= 'XXXXXX' 
and  not EXISTS (select NULL from tableB WHERE OPID=userID and tableB.project=tableA.projectCode and tableB.pageID=tableA.pageID)

 

posted @ 2019-04-29 16:03  Hoonick  阅读(844)  评论(0编辑  收藏  举报