title: Map integer(id) to text string?
body: <p>In my database, I'm storing a field called "type" as tinyInt, since I don't have that many types I decided not to create a table for storing the corresponding names of all these types.</p>
  
  <p>When I query my table I want the types to be replaced by their corresponding names which I'm storing in php arrays. I wonder if there is a way to do this replacement inside the sql statement itself instead of looping through the results and do replacement on the returned result row.</p>
  
  <p>Does something like this even exists:</p>
  
  <pre><code>select *, map(type, {1=&gt;'abc', 2 =&gt; 'xyz'}) from orders
  </code></pre>