From your statement "B.type==13" , it seems you wanted to implement a comparison of B.type with "13". Unfortunately oracle plsql doesnot support "==". You need to use a single "=" for any comparison. Look below the proof of concept for the same.