title: Mysql sub queries?
body: <p>I have a report table that looks similar to this</p>
  
  <pre><code>reports
  inspection_type | inspection_number
  berries         | 111 
  citrus          | 222
  grapes          | 333
  </code></pre>
  
  <p><code>inspection_type</code> in my case is the name of the other table I would like
  to <code>SELECT *</code> from where the <code>inspection_number</code> equals <code>report_key</code> on
  that associated table. </p>
  
  <pre><code>{fruit}
  row      | report_key | etc....
  value    | 111        | value
  value    | 222        | value
  </code></pre>
  
  <p>The issue is I do not know how to query inspection_type to get the table name
  to query the value. Does that make any sense?</p>
  
  <p>I tried this here, but even I know that it's glaringly wrong:</p>
  
  <pre><code>SELECT inpection_type, inspection_number
  FROM reports rpt
  ON rpt.inspection_number = report_key
  (SELECT * FROM inspection_type WHERE status &lt; '2')
  WHERE rpt.status &lt; '2'
  ORDER BY rpt.inspection_number DESC
  </code></pre>
  
  <p>Could a SQL guru tell me the best way to do this?</p>