title: MySql: unknown column id in 'field list'
body: <p>I am following the answer of this question:
  <a href="https://stackoverflow.com/questions/11237428/mysql-is-it-possible-to-group-concat-multiple-rows">MySQL: is it possible to group_concat multiple rows?</a></p>
  
  <p>But I struggle with the MySql error: </p>
  
  <blockquote>
    <p><code>#1054 - Unknown column 'CM_Cocktail.id' in 'field list'</code>.</p>
  </blockquote>
  
  <p>When I delete this CM_Cocktail.id stuff the next error apperars: <code>#1054 - Unknown column 'CM_Zutat.name' in 'field list'</code>. I tried to use aliases but it gone worse... Maybe I am blind. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>SELECT 
    CM_Cocktail.id, CM_Cocktail.name,
    GROUP_CONCAT(CM_Zutat.name SEPARATOR ', ')
  FROM (
    SELECT CM_Cocktail.id, CM_Cocktail.name AS cname, CM_Zutat.name
                FROM CM_Cocktail, CM_CocktailHatZutat, CM_Zutat
                WHERE CM_Cocktail.id=CM_CocktailHatZutat.cocktail_id
                AND CM_CocktailHatZutat.zutat_id=CM_Zutat.id
  ) group_attr
  GROUP BY CM_Cocktail.id;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>CREATE TABLE IF NOT EXISTS `CM_Cocktail` (
    `id` int(3) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>CREATE TABLE IF NOT EXISTS `CM_CocktailHatZutat` (
    `cocktail_id` int(3) NOT NULL,
    `zutat_id` int(3) NOT NULL,
    `zutat_menge` int(4) NOT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>CREATE TABLE IF NOT EXISTS `CM_Zutat` (
    `id` int(3) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;</code></pre>
  </div>
  </div>
  </p>