How to join same column twice?
<p>I'm building a trading site and have these tables</p>

<p>Example:</p>

<p>The First one is fruit. </p>

<pre><code>+----+--------+
| ID |  Name  |
+----+--------+
|  1 | Apple  |
|  2 | Orange |
|  3 | Banana |
+----+--------+
</code></pre>

<p>The Second one is the trading</p>

<pre><code>+-----+-------+--------+-------+
| tID | first | second | third |
+-----+-------+--------+-------+
|   1 |     2 |      1 |     3 |
|   2 |     3 |      1 |     2 |
+-----+-------+--------+-------+
</code></pre>

<p>I want to join them into a table show that whats the first/second/third means , like</p>

<pre><code>+-----+-------+--------+--------+-------+-------+--------+
| tID | first |   n1   | second |  n2   | third |   n3   |
+-----+-------+--------+--------+-------+-------+--------+
|   1 |     2 | Orange |      1 | Apple |     3 | Banana |
|   2 |     3 | Banana |      1 | Apple |     2 | Orange |
+-----+-------+--------+--------+-------+-------+--------+
</code></pre>

<p>Here is my sql </p>

<pre><code>SELECT trade.tid ,trade.first , fruit.name AS n1,trade.second ,     
fruit.name AS n2,trade.third , fruit.name AS n3
FROM trade 
INNER JOIN fruit 
ON trade.first=fruit.id
INNER JOIN fruit 
ON trade.second=fruit.id
INNER JOIN fruit 
ON trade.third=fruit.id
</code></pre>

<p>And I got the response is </p>

<pre><code>Error Code: 1066. Not unique table/alias: 'card'
</code></pre>

<p>What should I do ? Is my sql wrong or the database should not store data like this ?</p>