title: "group by" needed in count(*) SQL statement?
body: <p>The following statement works in my database:</p>
  
  <pre><code>select column_a, count(*) from my_schema.my_table group by 1;
  </code></pre>
  
  <p>but this one doesn't:</p>
  
  <pre><code>select column_a, count(*) from my_schema.my_table;
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>ERROR:  column "my_table.column_a" must appear in the GROUP BY clause
    or be used in an aggregate function</p>
  </blockquote>
  
  <p>Helpful note: This thread: <a href="https://stackoverflow.com/questions/7392730/what-does-sql-group-by-clause-group-by-1-mean">What does SQL clause &quot;GROUP BY 1&quot; mean?</a>  discusses the meaning of  "<code>group by 1</code>".</p>
  
  <h2>Update:</h2>
  
  <p>The reason why I am confused is because I have often seen <code>count(*)</code> as follows:</p>
  
  <pre><code>select count(*) from my_schema.my_table
  </code></pre>
  
  <p>where there is  <strong>no</strong> <code>group by</code> statement. Is <code>COUNT</code> always required to be followed by  <code>group by</code>? Is the <code>group by</code> statement implicit in this case?</p>