title: LEFT JOIN TABLE A AND TABLE B
body: <p>I have got 2 tables.</p>
  
  <p>Table_A: </p>
  
  <pre><code>  Doc_No |  BUCKET  |DPD
    ---------------
    21     |M1        |11 
    22     |M1        |11
    23     |M1        |15
    24     |M1        |19
    25     |M1        |13
    26     |M1        |18
    27     |M1        |12
  </code></pre>
  
  <p>Table_B: </p>
  
  <pre><code>  BUCKET    |USER1
    -----------------
    M1        |David
    M1        |Tom
    M1        |Kirby
  </code></pre>
  
  <p>And I would like to get results as a table below 
   (DPD is ordered by a-z)</p>
  
  <pre><code> Doc_No  |BUCKET    |DPD     |USER1
    --------------------------
   21      |M1        |11      |David
   22      |M1        |11      |Tom
   27      |M1        |12      |Kirby
   25      |M1        |13      |David
   23      |M1        |15      |Tom
   26      |M1        |18      |Kirby
   24      |M1        |19      |David
  </code></pre>
  
  <p>I don't know how to eliminate the redundant rows by using "normal" left join as below</p>
  
  <pre><code>    with a1 as
      (
          select *
              ,row_number() OVER (ORDER BY dpd) AS RowNum
          from TABLE_A
      )
  
  SELECT * 
  FROM a1 left join TABLE_B b on a1.BUCKET = b.BUCKET
  </code></pre>
  
  <p>I have used "Google" but I didn't have much luck finding any examples of this.</p>
  
  <p>Any help would be appreciated. (Sorry about my English)</p>