title: MySQL create temporary fields with values from another table
body: <p>Hi I am fairly familiar with basic SQL commands but I would like some help on doing this query which seems too complicated for me. Not  sure if it is even possible.</p>
  
  <p>I will try explain what I want to do :/</p>
  
  <p>Basically I want to create extra fields in a query which will display 'on' if the right conditions are found in another table.</p>
  
  <p>Table A contains the data for the user. Table B contains the achievements and are linked by the ID.</p>
  
  <p>There are different types of achievements and some are approved and declined. I am trying to get the approved achievements sorted into temporary fields that correspond to the type.</p>
  
  <p>I've provided a example of what I'm trying to do. <a href="http://nickhunt.org/query.png" rel="nofollow">Click here to view image</a> As its a tad hard to explain. Also I am trying to do this on MySQL.</p>
  
  <p>Any advice or comments would be greatly appreciated. Many thanks Nick</p>