Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

LIKE in the join still return data for null values

HarithAug 31 2017 — edited Sep 3 2017

Hello,

I'm trying to join two columns from different tables using LIKE, see the query below, I would expect the query should return nothing if there is no match in the join, this is not the case when there is null values in one of the columns, it still return data!!!

SELECT A.EDC, R.EDC_CODES

FROM RESULTS R

INNER join EDC_T A on A.EDC like ('%' || R.EDC_CODES ||'%');

i know for sure i have data in A.EDC(no nulls in this column) and there are possible null values in R.EDC_CODES, i know using nvl could solve it, but wondering why the query return data the way it written, in another words the query should exclude any data LIKE NULL but it is not, see what it return, those two columns used in the join?

pastedImage_2.png

thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 1 2017
Added on Aug 31 2017
18 comments
2,730 views