title: Select records in on table based on conditions from another table?
body: <p>I have got 2 tables, A, B</p>
  
  <pre><code>A: id is primary key and indexed
  
  id,  type_id,  status
  ------------------
  1,  1,  True
  2,  1,  False
  3,  2,  False
  ...
  
  B: (Type) type_id is primary key and indexed
  
  type_id, param
  ----------
  1,  23
  2,  35
  3,  24
  </code></pre>
  
  <p>I would like select all rows in <code>B</code> which has at least 1 associated entry in <code>A</code> with <code>status True</code></p>
  
  <pre><code>select distinct B.id, B.param 
  from B
  join A on A.type_id = B.type_id
  where A.status = true
  </code></pre>
  
  <p>Is this a good way?</p>