title: Is SELECT DISTINCT bad practice when you know a join will produce duplicates?
body: <p>On occasion when building a query I know I will have duplicates due to one of the joined tables. Is it better practice to remove those duplicates using a more rigorous join statement and/or using SELECT DISTINCT in a subquery, rather than using a SELECT DISTINCT statement for the entire thing?</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT PL.STATION,
  PL.PART_NUMBER,
  PD.DESCRIPTION
  FROM SAMPLE_DB.PART_LOCATOR PL
  LEFT JOIN PROD_SAMPLE_DB.PART_DETAIL PD
  ON PL.PART_NUMBER = PD.PART_NUMBER
  WHERE PL.PART_NUMBER = '4077968'
  AND PL.STATION = 'ATL'
  
  4 rows returned.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/O29dG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O29dG.png" alt="enter image description here"></a>
  <br></p>
  
  <p>Obviously I could just use a SELECT DISTINCT to get unique values:</p>
  
  <pre><code>SELECT DISTINCT PL.STATION,
  PL.PART_NUMBER,
  PD.DESCRIPTION
  FROM SAMPLE_DB.PART_LOCATOR PL
  LEFT JOIN PROD_SAMPLE_DB.PART_DETAIL PD
  ON PL.PART_NUMBER = PD.PART_NUMBER
  WHERE PL.PART_NUMBER = '4077968'
  AND PL.STATION = 'ATL'
  
  1 row returned.
  </code></pre>
  
  <p>But is this better form (making the join more specific)?</p>
  
  <pre><code>SELECT PL.STATION,
  PL.PART_NUMBER,
  PD.DESCRIPTION
  FROM SAMPLE_DB.PART_LOCATOR PL
  LEFT JOIN PROD_SAMPLE_DB.PART_DETAIL PD
  ON PL.PART_NUMBER = PD.PART_NUMBER
  AND PL.BIN_NUMBER = PD.BIN_NUMBER     &lt;--- Additional join criteria
  WHERE PL.PART_NUMBER = '4077968'
  AND PL.STATION = 'ATL'
  
  1 row returned.
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>SELECT PL.STATION,
  PL.PART_NUMBER,
  PD.DESCRIPTION
  FROM SAMPLE_DB.PART_LOCATOR PL
  LEFT JOIN 
  (
      SELECT DISTINCT     &lt;--- Add distinct statement in subquery
      PART_NUMBER,
      DESCRIPTION
      FROM
      PROD_SAMPLE_DB.PART_DETAIL
  ) PD
  ON PL.PART_NUMBER = PD.PART_NUMBER
  WHERE PL.PART_NUMBER = '4077968'
  AND PL.STATION = 'ATL'
  
  1 row returned.
  </code></pre>
  
  <p>What is considered best practice?</p>