title: How to customize SQL query result (select in select)
body: <p>This might be very simple solution but I am struggling for hours without any results. Let me show my problem with example. I have a table:</p>
  
  <pre><code>productID|attributeID|attributeValue
  001      | a01       | value1
  001      | a02       | value2
  002      | a01       | value2_1
  002      | a02       | value2_2
  </code></pre>
  
  <p>I have tried to use this query code:</p>
  
  <pre><code>SELECT 
      productID, 
      attributeValue,
      NEW_attributeValue = (SELECT attributeValue 
                            FROM table1 
                            WHERE attributeID = 'a02')
  FROM 
      table1
  WHERE 
      attributeID = 'a01'
  </code></pre>
  
  <p>Above query code is only my conception. Code fail because there is multiple results from second sub-query. Do you have idea how to receive this result:</p>
  
  <pre><code>001 | value1   | value2
  002 | value2_1 | value2_2
  </code></pre>