title: MySql get row with max revision from 2 different column
body: <p><strong>This is my Table:</strong>  </p>
  
  <pre><code>id  dl_id   rev1    rev2  
  1    48      1       0  
  2    48      1       1  
  3    50      0       2  
  4    50      1       2  
  5    50      2       1  
  </code></pre>
  
  <p><strong>This is wanted Result:</strong>  </p>
  
  <pre><code>id  dl_id  
  2   48  
  4   50
  </code></pre>
  
  <p>rev2 has more priority than rev1 , so I want id for dl_id with max revison.  </p>
  
  <p><strong>this is my query :</strong>  </p>
  
  <pre><code>select distinct dl_id,  
    (select id from myTable   
     where  dl_id=m.dl_id  
     order by rev2 desc,rev1 desc limit 0,1) as id  
  from myTable m 
  </code></pre>
  
  <p>my query is too slow , its took 4 seconds to run.
  I need a better query</p>