title: SQL - Select distinct rows and join them with another table to get data
body: <p>I have 2 tables:</p>
  
  <p>1) person (person_id, person_name)</p>
  
  <p>2) cars (car_id, person_id)</p>
  
  <p>I want to get all the people's names that have cars with no duplicates.</p>
  
  <p>This is what I have come up with:</p>
  
  <pre><code>SELECT person.person_name, cars.person_id
  FROM cars
  INNER JOIN person
  ON person.person_id=cars.person_id
  </code></pre>
  
  <p>But I don't want duplicates, so I need to incorporate it using something like this:</p>
  
  <pre><code>SELECT DISTINCT person_id FROM cars
  </code></pre>