title: What is wrong with my "group by" code in SQL?
body: <p>FEEDBACK table:</p>
  <pre><code>CREATE TABLE Feedback 
  (
      FeedbackID nvarchar(50) NOT NULL PRIMARY KEY, 
      Rating SMALLINT, 
      Comments nvarchar(50), 
      MemberID nvarchar(50) FOREIGN KEY REFERENCES Member(MemberID), 
      BookID NVARCHAR(50) FOREIGN KEY REFERENCES Book(BookID)
  ); 
  </code></pre>
  <p>BOOK table:</p>
  <pre><code>CREATE TABLE Book  
  (
      BookID nvarchar(50) NOT NULL PRIMARY KEY, 
      Name nvarchar(50), 
      SerialNumber nvarchar(50), 
      CategoryID nvarchar(50) FOREIGN KEY REFERENCES Category(CategoryID), 
      PublisherID NVARCHAR(50) FOREIGN KEY REFERENCES Publisher(PublisherID), 
      Unit_Price nvarchar(50), 
      Quantity NVARCHAR (50)
  ); 
  </code></pre>
  <p>I have only managed to get this by using</p>
  <pre><code>SELECT BookID, COUNT(FeedbackID) AS Numoffeedback 
  FROM Feedback 
  GROUP BY BookID;
  
  BookID | TotalNumberofFeedbacks
  -------+-----------------------
  </code></pre>
  <p>But my desired output is this :</p>
  <pre><code>BookID | Name | TotalNumberofFeedbacks
  -------+------+-----------------------
  </code></pre>
  <p>I tried do this</p>
  <pre><code>SELECT BookID, COUNT(FeedbackID) AS Numoffeedback 
  FROM Feedback 
  GROUP BY BookID, Name; 
  </code></pre>
  <p>but i received this error &quot;Invalid column name 'Name'.</p>