title: Lookup with duplicate values
body: <p>This is kind of a complicated question. I have three tables:</p>
  <p>A PRODUCTS table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ProductID</th>
  <th>ProductName</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Product A</td>
  <td>Edwardian Desk</td>
  </tr>
  <tr>
  <td>Product B</td>
  <td>Edwardian Lamp</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>And a GROUPS table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ProductGroup</th>
  <th>ProductID</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Group A</td>
  <td>Product A</td>
  </tr>
  <tr>
  <td>Group A</td>
  <td>Product B</td>
  </tr>
  <tr>
  <td>Group B</td>
  <td>Product C</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>And a SALES table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Product ID</th>
  <th>Sales</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Product A</td>
  <td>1000</td>
  </tr>
  <tr>
  <td>Product B</td>
  <td>500</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>And I need to show the total of Sales per Product Group.</p>
  <p>This part I understand; I wrote the query:</p>
  <pre><code>SELECT Groups.ProductGroup, SUM(Sales) AS TotalSales
  FROM Groups
  JOIN Sales
  ON Groups.ProductID=Sales.ProductID
  GROUP BY Groups.ProductGroup
  </code></pre>
  <p>This is the part that confuses me though: for each group, I need to pull in one of the names of the products in the group. However, it does not matter which name is pulled. So the final data could show:</p>
  <pre><code>Group A, Edwardian Desk, 1500
  </code></pre>
  <p>or</p>
  <pre><code>Group A, Edwardian Lamp, 1500
  </code></pre>
  <p>How can I pull the name of the product into my query?</p>
  <p>I am working in Microsoft SQL Server</p>