title: MySQL - JOIN a OR b
body: <p>Let's say I have a <code>TABLE a</code> in which a <code>COLUMN data</code> is the one to <strong>join</strong> on for 2 other tables (<code>TABLE b</code> and <code>TABLE c</code>) because I want to get a <code>COLUMN info</code> in <code>b</code> or <code>c</code>.<br>
  The thing is <code>a.data</code> will match <strong>only</strong> with <code>b.data</code> <strong>or only</strong> with <code>c.data</code>.</p>
  
  <ul>
  <li>How can I get <code>b.info</code> or <code>c.info</code> based on <code>a</code> ?</li>
  </ul>
  
  <p><br></p>
  
  <h3>How far did I try:</h3>
  
  <p>After many attempts with obviously wrong syntax, the best I did was in 2 queries:</p>
  
  <pre><code>SELECT b.info FROM a INNER JOIN b ON a.data = b.data
  SELECT c.info FROM a INNER JOIN c ON a.data = c.data
  </code></pre>
  
  <p>I would like to achieve something that could look like this:</p>
  
  <pre><code>SELECT alias.info FROM a INNER JOIN (b OR c) AS alias ON a.data = alias.data
  </code></pre>
  
  <p><br></p>
  
  <h3>Why do I want to do this</h3>
  
  <p>Actually I can get the data I want and work with it using PHP. But I am making a huge process (unrelated to my question) instead of a good query and the page takes too much time to load.</p>