title: Columns invalid because it's not contained aggregate function
body: <blockquote>
  <p>Column 'Noodle.NoodleID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.</p>
  </blockquote>
  <p>I am using Microsoft SQL Server. How do I solve this?</p>
  <p>My syntax query is</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT 
  [NoodleID] = REPLACE(Query.NoodleID, 'NO', 'Noodle'),
  NoodleName,
  NoodlePrice = 'Rp' + CAST(NoodlePrice AS VARCHAR)
  FROM Noodle Query,
  (
      SELECT 
      n.NoodleID,
      [Noodle Avg] = AVG(n.NoodlePrice)
      FROM Noodle n
      JOIN SalesTransactionDetail std ON std.NoodleID = n.NoodleID
      JOIN SalesTransaction st ON st.SalesTransactionID = std.SalesTransactionID
      WHERE DATENAME(MONTH, TransactionDate) = 'Wednesday'
  ) AS SubQuery
  WHERE Query.NoodleID = SubQuery.NoodleID
  GROUP BY NoodleName,NoodlePrice
  </code></pre>