MySQL Join with several CASE WHEN : <p>I need some help with MySQL where I want to JOIN with a CASE WHEN. I am getting 3 columns from statement below. </p>

<p>I would like to add from table Customer.name so I get a 4th column with Customer Name. 
Table CustomerCategory has foreign key and ID from Customer.CustomerID<br>
Also every customer has an id but not necessary a CustomerCode, null exists. 
Tried many versions of join but...</p>

<pre><code>SELECT
(CASE WHEN CustomerCategory.CustomerCode = "CUST01" THEN "Distributor" ELSE " " END ) AS Distributor,
(CASE   when when CustomerCategory.CustomerCode = "CUST02" THEN "Retail" ELSE " " END ) AS Retail,  
(CASE WHEN CustomerCategory.CustomerCode = "CUST03" THEN "Enduser"   ELSE " " END ) AS Enduser
from CustomerCategory
</code></pre>
