title: SQL Group By comparison with Python Group By error
body: <p>I have written the following sql query:</p>
  
  <pre><code>SELECT
    *
  FROM CSVDatabase.dbo.sales_info
    GROUP BY Company HAVING AVG(Sales)
  </code></pre>
  
  <p>Its based on the following dataset</p>
  
  <p><img src="https://i.stack.imgur.com/trOXP.png" alt="dataset"></p>
  
  <p>However, I get the following error:</p>
  
  <blockquote>
    <p>1 An expression of non-boolean type specified in a context where a condition is expected, near 'SET'.</p>
  </blockquote>
  
  <p>I'm trying to get the mean across the whole dataset.</p>
  
  <p>I have also written a python script that sets out to accomplish the same results as that in the sql script above, as follows:</p>
  
  <pre><code>df.groupBy('Company').mean().show()
  </code></pre>
  
  <p>The python script returns the results I would like to see from sql as shown below:</p>
  
  <p><img src="https://i.stack.imgur.com/bqjYm.png" alt="dataset2"></p>
  
  <p>Can someone let me know where I'm going wrong with the sql script?</p>