title: Select Name instead OF ID in table with ID-Ref Column SQL
body: <p>Lets say we have 2 Tables:</p>
  
  <pre><code> Table A        Table B
   - A_ID         - B_ID
   - A_Name       - A_ID
  </code></pre>
  
  <p>I need a select statement, that selects * from Table B showing the <code>A_NAME instead of the A_ID</code>.</p>
  
  <p>By trying it I got the following select statement which ... doesn't work to well. It is giving me a lot of nulls, but no names.</p>
  
  <pre><code>SELECT B_ID, 
         (select A_NAME from TableA as A where A.A_ID = B.A_ID) as Name
  FROM TableB as B
  </code></pre>
  
  <hr>
  
  <p><strong>Thanks for all your Answers</strong>.</p>
  
  <p><strong><em>The final solution:</em></strong> </p>
  
  <p>The shown query DOES work (even though it may be slow) and the solutions in the answers also do work. </p>
  
  <p>The problem why it didn't give results for me was because of my data. On another database with the same schema all the commands work.</p>