title: Sql : left join exclude values based on another table
body: <p>I am trying to figure out this without any success i have tried going through several posts but cannot come to a solution. Situation is like this : ( There are no foreign key constraints )<code>
  Table A   ID | VAL     Table B ID|VAL|TEMP       RESULT REQUIRED<br>
             1 | A                1| A | 2           A
             1 | B                1| A | 2           C
             1 | C                1| B | 1           D
             1 | D                1| C | 2           E
             1 | E                1| D | 2           F
             1 | F                1| G | 6           H
             1 | H
  </code>
  
  When i run<br/> <code>SELECT DISTINCT A.VAL,B.TEMP FROM A 
  LEFT JOIN B 
  ON A.VAL=B.VAL AND B.TEMP > 1
  </code> This is returning all rows of TABLE A and rows which are common to TABLE B but not validating the condition ( b.val > 1) because since row B is in Table A, it is getting included in the result . However i want that if val b &lt; 2 then it should be not included in result.</p>