Combine 2 tables into 1
<p>How would I combine 2 tables into 1? Maybe using INNER JOIN? Please advise. Thank you.</p>

<p>For example, with the following db I just created: </p>

<p>Table 1</p>

<pre><code>  +----------------------+
  | Places               |
  +----------------------+
  | Cupertino            |
  | BJ's Restaurant      |
  | Cupertino Inn        |
  | Outback Steakhouse   |
  +----------------------+ 
</code></pre>

<p>Table 2</p>

<pre><code>  +----------------------+
  | Distant              |
  +----------------------+
  | 0.6 km               |
  | 1.3 km               |
  | 1.3 km               |
  | 1.1 km               |
  +----------------------+ 
</code></pre>

<p>Select syntax and combine this table output would be something like this:</p>

<pre><code>+---------------------+---------+
| Places              | Distant |
+---------------------+---------+
| Cupertino           | 0.6 km  |
| BJ's Restaurant     | 1.3 km  |
| Cupertino Inn       | 1.3 km  |
| Outback Steakhouse  | 1.1 km  |
+---------------------+---------+ 
</code></pre>

<p>**Edit: Sorry forgot to add id. Updated below:</p>

<p>Table 1</p>

<pre><code>+-----------+--------------------+
|Places_Id  | Places             |
+-----------+--------------------+
| 1         | Cupertino          |
| 2         | BJs Restaurant     |
| 3         | Cupertino Inn      |
| 4         | Outback Steakhouse |
+-----------+--------------------+ 
</code></pre>

<p>Table 2</p>

<pre><code>+------------+----------+
|Distant_Id  | Distant  |
+------------+----------+
| 1          | 0.6 km   |
| 2          | 1.3 km   |
| 3          | 1.3 km   |
| 4          | 1.1 km   |
+------------+----------+ 
</code></pre>

<p>Places_Id and Distant_Id is <code>Auto Increment</code>. So sorry guys, suddenly my brain stop working after long time not doing programming related. Turns out this is so easy after add the id into database. Thanks guys for all the answers. Keep it up.</p>

<pre><code>Select A.Places, A.Places_Id, B.Distant, B.Distant_Id from Table1 A, Table2 B where B.Distant_Id = A.Places_Id
</code></pre>