title: Is SELECT DISTINCT always redundant when using a GROUP BY clause?
body: <p>Is there a case where adding DISTINCT would change the results of a SELECT query that uses a GROUP BY clause?</p>
  
  <p><a href="http://blog.sqlauthority.com/2007/03/29/sql-server-difference-between-distinct-and-group-by-distinct-vs-group-by/" rel="nofollow">Group by and distinct produce similar execution plans.</a></p>
  
  <p>From my understanding, tables that use a GROUP BY clause can only have columns from the GROUP BY or aggregate functions.</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/ms173454.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow">List of aggregate functions</a> appears to be deterministic and combinations from the GROUP BY would be unique so my assumption is that it would be redundant.</p>
  
  <p><strong>EDIT 1:</strong> Adding the DISTINCT keyword directly after SELECT. Not anywhere in the query like @lad2025's example: SELECT name, COUNT(DISTINCT col) ... GROUP BY name. </p>