title: Distinct mysql query combine
body: <pre><code>select m.*, c.NAME as CORP_NAME 
  from MAIL_LOG as m, CORP as c 
  where m.SEND_DATE &gt;= '$term_from' and m.SEND_DATE &lt;= '$term_end' ";
  </code></pre>
  
  <p>with</p>
  
  <pre><code>Select DISTINCT `TO_NAME_F_KANA` from MAIL_LOG group by m.SEND_DATE;
  </code></pre>
  
  <p>I like to get unique values from the first query with the <code>TO_NAME_F_KANA</code> as reference.</p>