title: invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause
body: <p>I have searched about this error and amended my query and used my order by column in aggregate function as well.
  May be due to lesser knowledge of sql I am unable to catch exact meaning of this error.</p>
  
  <p>I have following columns in my table:</p>
  
  <blockquote>
    <ul>
    <li>[id] </li>
    <li>[post_id]</li>
    <li>[user_id]</li>
    <li>[photo_id]</li>
    <li>[photo_group_id]</li>
    <li>[album_id]</li>
    </ul>
  </blockquote>
  
  <p>my query:</p>
  
  <pre><code>SELECT TOP 3 MAX(share.id) as share_id, share.user_id 
  FROM share  
  WHERE share.post_id = 5468   
  GROUP BY share.user_id 
  ORDER BY share.id desc
  </code></pre>
  
  <p>I am using order by column in aggregate function already still it showing </p>
  
  <blockquote>
    <p>Column "share.id" is invalid in the ORDER BY clause because
    it is not contained in either an aggregate function or the GROUP BY
    clause.</p>
  </blockquote>
  
  <p>Any help will be appreciated. :)</p>