title: Mysql : Using derived table in subquery
body: <p>In my (very simplified) schema, i have 3 tables : offers, attributes, attributes_offers.</p>
  
  <p>I want to use subquery from a derived table, in this query : </p>
  
  <pre><code>SELECT
      o.offer_id,
      GROUP_CONCAT(CONCAT(attr.attribute_code,'-',attr.value_id,'-',attr.value_value) SEPARATOR ';') AS attributes,
      (SELECT attr.value_id FROM attr WHERE attribute_code = 'area') AS area_id,
      (SELECT attr.value_id FROM attr WHERE attribute_code = 'category') AS category_id
  FROM   offers o
  INNER JOIN (
      SELECT offer_id,attribute_code,value_id,value_value
      FROM   attributes_offers ao
      INNER JOIN attributes att USING (attribute_code) 
  ) AS attr ON attr.offer_id = o.offer_id
  </code></pre>
  
  <p>But MySql answers me : <code>Table 'attr' doesn't exist</code>.</p>
  
  <p>Group_concat works well.</p>
  
  <p>Is there a way to use my derived table attr in select subquery?</p>