title: How to return multiple rows when using Aggregate functions?
body: <pre><code>SELECT StudentID, Fname, LName, S_LessonNumber, LessonName, Date, Cost
  FROM STUDENT_2
  JOIN LESSON ON S_LessonNumber = LessonNumber
  NATURAL JOIN STUDENT_1
  WHERE StudentID = '1001'
  </code></pre>
  
  <p>The resulting table I get with this query is as follows,</p>
  
  <p><a href="https://i.stack.imgur.com/7S0cD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7S0cD.png" alt="enter image description here"></a></p>
  
  <p>When attempting to display the total amount paid, and the total number of lessons taken, using the following query, I was only able return one row.</p>
  
  <pre><code>SELECT StudentID, Fname, LName, S_LessonNumber, LessonName, Date,
  Cost,COUNT( DISTINCT S_LessonNumber ) , SUM( Cost )
  FROM STUDENT_2
  JOIN LESSON ON S_LessonNumber = LessonNumber
  NATURAL JOIN STUDENT_1
  WHERE StudentID = '1001'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KwYIx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KwYIx.png" alt="enter image description here"></a></p>
  
  <p>Is there a way that I can return all 4 rows with the values for COUNT(DISTINCT S_LessonNumber) and SUM(Cost) repeated.</p>
  
  <p>The desired output is as follows:</p>
  
  <pre><code>StudentID FName    LName   S_LessonNumber LessonName Date Cost COUNT SUM
  1001      Hannibal Lecter  7              C---       ---  15   4     60 
  1001      Hannibal Lecter  6              Wa--       ---  15   4     60 
  1001      Hannibal Lecter  5              Tri--      ---  15   4     60 
  1001      Hannibal Lecter  1              Cha-       ---  15   4     60 
  </code></pre>