title: retrieve data from 2 tables using conditions
body: <p>I have 2 tables</p>
  
  <pre><code>+---------------------+
  |       T_EQUIPMENT   |
  +----+--------+---+---+
  | ID | NAME   |APPROVED|
  +----+--------+---+---+
  | 01 | foo1   |  0    |
  +----+--------+---+---+
  | 02 | foo2   |  1    |
  +----+--------+---+---+
  | 03 | foo3   |  1    |
  +----+--------+---+---+
  | 04 | foo4   |  1    |
  +----+--------+---+---+
  
  +---------------------------+
  |       T_HAS_EQUIPMENT     |
  +----+------------+----+----+
  | ID_CENTER | ID_EQUIP      |
  +----+------------+----+----+
  |     12    |      2        |
  +----+------------+----+----+
  |     3     |      3        | 
  +----+------------+----+----+
  |     3     |      2        |
  +----+------------+----+----+
  |     5     |      3        |
  +----+-----------+----+----+
  |     6     |      2        |
  +----+------------+----+----+
  </code></pre>
  
  <p>I want to get the id,name of approved equipment (APPROVED=1) but also whether or not this specific center has this equipment</p>
  
  <p>for example for id_center = 3 i want this   </p>
  
  <pre><code>    +---------------------+
      |       RESULT        |
      +----+--------+---+---+
      | ID | NAME   |  HAS  |
      +----+--------+---+---+
      | 02 | foo2   |  1    |
      +----+--------+---+---+
      | 03 | foo3   |  1    |
      +----+--------+---+---+
      | 04 | foo4   |  0    |
      +----+--------+---+---+
  </code></pre>
  
  <p>so, i retrieve all equipment, and i know whether or not a center has this equipment.  Any ideas?</p>