Home > database > Of new ask a question, why the two different query results
Of new ask a question, why the two different query results
Time:10-13
T.m aren't gr is the six Numbers, why is not the same as the query results?
CodePudding user response:
Select distinct e.e name from emp e join (select distinct MGR from emp where MGR is not null) t on e.e mpno not in (t.m gr); It is your first SQL, the result is 14 records, namely all records, no filter, The main problem is the part of the scarlet letter "join", should be rewritten as "inner join", Your statement practical effect is on the left side of the emp "e", there is no connection to the record will show that is equivalent to the left of the join effect,