Tag Archives: Oracle

Performance differences between IN and EXISTS

Very often I hear people wondering if it’s better the EXISTS or the IN operator. Let’s start by saying that the two operators behave differently when NULL values are involved (see this post). If you are sure that the field … Continue reading

Posted in IT, Programming | Tagged , | Leave a comment

NOT IN vs. NOT EXISTS when NULL values are involved

NOT IN does not behave as you would expect when NULL values are involved. Suppose you have the following tables: TABLE_A CD_FIELD DS_FIELD 1 ALPHA 2 BETA TABLE_B CD_FIELD DS_FIELD 1 GAMMA NULL DELTA Now try the following query: SELECT … Continue reading

Posted in IT, Programming | Tagged , | Leave a comment