title: #1054 - Unknown column 'a.group_id' in 'where clause'
body: <p>Why does the query give me this error: <code>#1054 - Unknown column 'a.group_id' in 'where clause'</code> ?</p>
  
  <pre><code>SELECT a.group_id
  FROM message_private a
  INNER JOIN (SELECT group_id,profile_id
       FROM message_group b
       WHERE a.group_id = b.group_id AND b.profile_id = 's'
  ) as b ON b.group_id = a.group_id 
  </code></pre>