title: Missing right parenthesis subquery
body: <p>This query returns missing right parenthesis although when I run the inside query it runs fine.</p>
  
  <pre><code> select t.id 
   from
   (select
    v.id,
    max(c.image_type_id),
    max(vp.x), 
    max(vp.y),
    max(vp.z)
    FROM
    v,
    vp,
    c,
    WHERE v.id = vp.id 
    AND v.id = c.id
    group by v.id;) t
  </code></pre>