inner joins with where clause for no values? I have 2 tables :

Table1


Parent(varchar) Child (varchar)


Table2


C1(varchar)    PC (varchar)


Sample data:



Requirement - I need Table2.C1 values for which column Table2.PC = Table1.Child , but Child values must be different from Table1.Parent's values..

I'm using below query in mysql:

select distinct(C1),Child,PC 
  from Table2 inner join Table1 
    on Table2.PC=Table1.Child 
 where Table1.Child not in (select Parent from Table1);


It is giving empty set, but there are values in Child which is same as in PC, but not in Parent....

Where I'm getting wrong?
The "where" clause excludes everything in Table1

Provide sample data in the question if you would like an SQL query example