title: SELECT and create new ID for unique ids having identical values on 2 columns
body: <p>My table</p>
  
  <pre><code> ID  Name    Addr   tDate
  -------------------------------
  | 1 | Aa  |  street |  20151231
  | 2 | Aa  |  street |  20130202
  | 2 | Aa  |  street |  20120101
  | 3 | Aa  |  way    |  20150821
  | 4 | Bb  |  street |  20150821 
  | 7 | Xb  |  street |  20150821 
  | 5 | Cc  |  way    |  20150821
  | 5 | Cc  |  way    |  20150821
  | 6 | Cc  |  no way |  20150821
  </code></pre>
  
  <p>Result 01 </p>
  
  <pre><code> ID  Name    Addr   | tDate
  -------------------------------
  | 1 | Aa  |  street |  20151231
  | 2 | Aa  |  street |  20130202
  | 2 | Aa  |  street |  20120101
  </code></pre>
  
  <p>Going to create a new <code>nID</code> 
  It should be copied as is OR merged if Name and Addr are identical and selecting <code>ID</code> with newest <code>tDate</code></p>
  
  <p>Result 02</p>
  
  <pre><code> ID  Name    Addr      tDate      nID
  ------------------------------------
  | 1 | Aa  |  street |  20151231 | 1
  | 2 | Aa  |  street |  20120101 | 1    &lt;-- nID != ID
  | 2 | Aa  |  street |  20130202 | 1    &lt;-- nID != ID
  | 3 | Aa  |  way    |  20150821 | 3
  | 4 | Bb  |  street |  20150821 | 4 
  | 7 | Xb  |  street |  20150821 | 7 
  | 5 | Cc  |  way    |  20150821 | 5
  | 5 | Cc  |  way    |  20150821 | 5
  | 6 | Cc  |  no way |  20150821 | 6
  </code></pre>
  
  <p>I've tried this. Not sure if it's correct. </p>
  
  <pre><code>   SELECT DISTINCT dr.*
                  FROM MyTable dr
                  inner join(
                      SELECT ID, Name, Addr
                      FROM MyTable
                      GROUP BY ID, Name, Addr
                  ) ss on dr.Name = ss.Name and 
                          dr.Addr = ss.Addr and 
                          dr.ID &lt;&gt; ss.ID 
                  order by Name
  </code></pre>