oracle 两种方法不同的效率!务必少使用 not in

    技术2022-05-11  76

     两种方法不同的效率!

    方法1

    select * from userinfo,achieveamount where userinfo.unionid = achieveamount.unionid(+) and  achieveamount.unionid IS NULL

    方法2

    select * from userinfo where userinfo.unionid not in (select achieveamount.unionid from achieveamount)

     

    我们要采用方法1这样性能要比2好很多!


    最新回复(0)