title: LeftJoin Minus (Right Table data + inner join Data)
body: <p><strong>TABLE 1)</strong><br>
  m_conservationsetting</p>
  
  <pre><code>+------------+-------+------------+
  | FacilityId | Unit  | CategoryId |
  +------------+-------+------------+
  |     1      |    1  |      1     |
  |     1      |    1  |      2     |
  |     1      |    1  |      3     |
  |     1      |    2  |      1     |
  |     1      |    2  |      2     |
  |     2      |    1  |      1     |
  |     2      |    2  |      1     |
  +------------+-------+------------+
  </code></pre>
  
  <p>Unique Key(FacilityId  Unit CategoryId)</p>
  
  <p><strong>TABLE 2)</strong><br>
  l_maintelog</p>
  
  <pre><code>+------------+------+------------+--------+
  | FacilityId | Unit | CategoryId | Status |
  +------------+------+------------+--------+
  |    1       |   1  |      1     |    0   |
  |    1       |   1  |      2     |    1   |
  |    1       |   1  |      3     |    0   |
  |    1       |   2  |      1     |    0   |
  |    2       |   1  |      1     |    0   |
  |    2       |   2  |      1     |    0   |
  +------------+------+------------+--------+
  </code></pre>
  
  <p><strong>Result :</strong></p>
  
  <pre><code>+------------+------+------------+
  | FacilityId | Unit | CategoryId |
  +------------+------+------------+
  |     1      |  1   |     2      |
  |     1      |  2   |     2      |
  +------------+------+------------+
  </code></pre>
  
  <p>Table1 need to be left Joined  with Table2 and it should ommit the join results and show only table1 data as results.<br>
  Table1 LeftJoin Table2 - (join Data) for the below query. The condition for getting result is to check the status=0 for the record in Table2 </p>
  
  <p><strong>Query</strong></p>
  
  <pre><code>select cs.FacilityId,Cs.Unit,cs.CategoryId 
  from m_conservationsetting cs 
  LEFT JOIN l_maintelog ml on
  (cs.FacilityId=ml.FacilityId and cs.Unit=ml.Unit)
  WHERE (ml.Status=0
  ) 
  group by cs.CategoryId
  </code></pre>