title: T-SQL - How to Select and Group Multiple Records (in multiple columns) for Each Employee?
body: <p>We have a table that looks like following:</p>
  
  <pre><code>DATAID Last_Name    First_Name   ADDRESS
  1         Smith        John         5000 Street
  2         Smith        John         6666 Street
  3         Doe          Jim          1111 Street
  4         Doe          Jim          2222 Street
  </code></pre>
  
  <p>As you can see, <code>DATAID</code> is a unique field. Same employee has multiple addresses listed in multiple columns. There are many other columns with unique data for each employee which I didn't include in the example table above. For e.g., phone number, email, etc.</p>
  
  <p>How can I group multiple records for each employee by employee's first and last name? I tried to do a JOIN and didn't get desired results. I also couldn't figure out how to return desired results by running <code>DISTINCT on first_name and last_name</code> only and displaying relevant data for each employee from multiple columns.</p>