title: SQL Group By, Distinct confusion
body: <p>I have a program that is linked to a sql DB, with 2 tables - <code>Customers</code> and <code>SInfo</code>.</p>
  
  <p>Customers has the normal columns:</p>
  
  <pre><code>CUSTOMERID   (Primary Key)
  FIRSTNAME
  LASTNAME
  EMAIL
  </code></pre>
  
  <p>SInfo has details about the Customer:</p>
  
  <pre><code>SSheetID     (Primary Key)
  CustomerID
  SerialNumber
  </code></pre>
  
  <p>When I use the query builder in .net, I use an <code>inner join</code> to combine the tables, and use a filter to search for a serial number, but I am getting an error when the primary key is shown more than once.</p>
  
  <p><a href="https://i.stack.imgur.com/i77Hh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i77Hh.jpg" alt="enter image description here"></a></p>
  
  <p>I tried to use <code>distinct</code>, but if one field was different, I would get the error, and <code>GROUP BY</code> is killing me.</p>
  
  <p>So my question is, what would be the best practice if a Customer (CustomerID) has the same Serial Number more than once, but I just want to show that CustomerID once, but still fill out FirstName, LastName, Email?</p>
  
  <p>Any help is appreciated.</p>