title: SQL query returning all rows from Table2
body: <p>I am trying to join 2 tables and return data if the Table1.codeId is presented on Table2 OR if Table1.codeId = 0. However, It retrieves the data from Table2.</p>
  <pre><code>Table1 {
     name nvarchar,
     codeId int
   }
  
  |  name  | codeId |
  |--------|--------|
  |  Bob   |    1   |
  |  Bob   |    2   |
  |  Chris |    0   |
     
  
  Table2 {
     id int,
     codeName nvarchar
   }
  
  |  id  | codeName |
  |------|----------|
  |  1   | Engineer |
  |  2   | Doctor   |
  |  3   | Dentist  |
  |  4   | Pilot    |
  |  5   | Mechanic |
     
  
  SELECT t1.name, t2.codeName
   FROM dbo.Table1 t1, dbo.Table2 t2
   WHERE (t1.codeId = t2.id OR t1.codeId = 0)
  </code></pre>
  <p>Expected result:</p>
  <pre><code>Bob, 1
  John, 2
  Chris, 0
  </code></pre>