title: Distinct value from multiple tables in mysql
body: <p>I have 4 tables which contains "ID"  and 1 table which contains "ID" &amp; "TEAM". All "ID"'s  from the first four tables is also stored in the fifth table with a "TEAM"-name attached to it. The tables contains more data than id but its not relevant.</p>
  
  <p>I want to select "ID" from the 4 tables WHERE "TEAM" is a chosen one from me. I want them all in the same array to use in mysql_fetch_array to output rows.</p>
  
  <p>I've tried a lot of things but cant work it out how to get correct output. I need a distinct output so multiples shall not be written out. Appreciate all help! </p>
  
  <pre><code>TABLE1
  
  ID : 50454
  ID : 50454
  ID : 50454
  ID : 30545
  
  
  TABLE2
  
  ID : 20876
  ID : 10678
  ID : 10678
  ID : 10678
  
  
  TABLE3
  
  ID : 60321
  ID : 90123
  
  
  TABLE4
  
  ID : 32505
  ID : 32505
  ID : 32505
  ID : 32151
  
  
  TABLE5
  
  ID : 32505        TEAM : ALFA
  ID : 32151        TEAM : ALFA
  ID : 90123        TEAM : ALFA
  ID : 60321        TEAM : ALFA
  ID : 50454        TEAM : BETA
  ID : 30545        TEAM : BETA
  ID : 20876        TEAM : BETA
  ID : 10678        TEAM : BETA
  </code></pre>