title: Not a GROUP BY expression error
body: <p>I'm relatively new to databases. I am using Oracle and I'm trying to implement this query to find the number of personal training sessions the member has had.</p>
  
  <p>The tables are;</p>
  
  <p><strong>MEMBERS</strong>  </p>
  
  <pre><code>MEMBERS_ID(NUMBER),
  MEMBERSHIP_TYPE_CODE(VARCHAR),
  ADDRESS_ID(NUMBER), CLUB_ID(NUMBER) 
  MEMBER_NAME(VARCHAR), 
  MEMBER_PHONE(VARCHAR), 
  MEMBER_EMAIL(VARCHAR)
  </code></pre>
  
  <p><strong>PERSONAL_TRAINING_SESSIONS</strong></p>
  
  <pre><code>SESSION_ID(VARHCAR), 
  MEMBER_ID (NUMBER), 
  STAFF_ID(VARCHAR), 
  SESSION_DATETIME(DATE)
  </code></pre>
  
  <p>My query is returing this error:</p>
  
  <blockquote>
    <p>ORA-00979: not a GROUP BY expression
    00979. 00000 -  "not a GROUP BY expression"
    *Cause:<br>
    *Action: Error at Line: 1 Column: 8</p>
  </blockquote>
  
  <pre><code>SELECT MEMBERS.MEMBER_ID,MEMBERS.MEMBER_NAME, COUNT(personal_training_sessions.session_id)
  FROM MEMBERS JOIN personal_training_sessions
  ON personal_training_sessions.member_id=members.member_id
  GROUP BY personal_training_sessions.session_id;
  </code></pre>
  
  <p>Can anyone point me in the right direction? I have looked around do I need to separate the count query?</p>