SQL Language (MOSC)

MOSC Banner

NOT IN not returning any results even after NOT NULL statement

edited Jan 31, 2018 10:06AM in SQL Language (MOSC) 7 commentsAnswered ✓

"NOT IN" statement not returning any records even after adding the not null in the subquery. The sub query has 6 million records and the out query has 6 records so ideally i should get 6 million minus 6 records in the below query, but i am getting zero records, The "IN" is working and returning 6 records.

select ELEMENT_ENTRY_ID from WC_TERM_ELEMENT_ENTRY_INFO_STG  WHERE ELEMENT_ENTRY_ID NOT IN(SELECT DISTINCT ELEMENT_ENTRY_GUID FROM WC_ELEMENT_ENTRIES_D WHERE ELEMENT_ENTRY_GUID IS NOT NULL

);

Any help will be greatly appreciated.

Thanks

Amit

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center