title: MySQL: SELECT from different tables with a common ID
body: <p>this is my first post after hundreds of times I've visited your site.</p>
  
  <p>Simple question.</p>
  
  <p>I have Two Tables, indipendent, different in all, with only one common column. 
  We call it ID_Client</p>
  
  <p>I don't have to modify these tables but I want to merge them and make on this a Select Query.</p>
  
  <p>Table A</p>
  
  <pre>
  Col_ID    |Col 1    |Col 2    |Col 3    |
  ----------|---------|---------|---------|
  40302025  |50       |  60     |  70     |
  40302028  |50       |  60     |  70     |
  40302030  |50       |  60     |  70     |
  40302055  |50       |  60     |  70     |
  40302074  |50       |  60     |  70     |
  </pre>
  
  <p>Table B</p>
  
  <pre>
  Col_ID    |Col X    |Col Y    |Col Z    |
  ----------|---------|---------|---------|
  40302025  |ABC      |  CDE    |  7ASE   |
  40302028  |ABC      |  CDE    |  7ASE   |
  40302030  |ABC      |  CDE    |  7ASE   |
  40302055  |ABC      |  CDE    |  7ASE   |
  40302074  |ABC      |  CDE    |  7ASE   |
  </pre>
  
  <p>Table results</p>
  
  <pre>
  Col_ID    |Col X    |Col Y    |Col Z    |Col 1    |Col 2    |Col 3    |
  ----------|---------|---------|---------|---------|---------|---------|
  40302055  |ABC      |  CDE    |  7ASE   |50       |  60     |  70     |
  40302074  |ABC      |  CDE    |  7ASE   |50       |  60     |  70     |
  </pre>
  
  <p>I have to query (like "Order", "Limit" and so on) so that the first table is dependent on the second and vice versa.</p>
  
  <p>Example: I want to sort the column 2 of Table A, based on the X column of Table B where ID> 40302030</p>
  
  <p>Example 2: I want to select column 3 of Table A and column B of Table X where ID> 40302030</p>
  
  <p>I do not want the query to solve these examples, but I want to understand what function should I use. I tried UNION, UNION ALL, JOIN but maybe I did not understand the optics of use.</p>
  
  <p>It sounds like "I want to merge two table in one and then I make the query like SELECT, ORDER BY, WHERE etc."</p>
  
  <p>Thanks and sorry for my english</p>
  
  <p>Carlo</p>