2
select m.*, c.NAME as CORP_NAME 
from MAIL_LOG as m, CORP as c 
where m.SEND_DATE >= '$term_from' and m.SEND_DATE <= '$term_end' ";

Select DISTINCT `TO_NAME_F_KANA` from MAIL_LOG group by m.SEND_DATE;

TO_NAME_F_KANAas 参照を使用して、最初のクエリから一意の値を取得するのが好きです。

4

1 に答える 1

1

次のクエリはトリックを行う必要があります

Select DISTINCT t.`TO_NAME_F_KANA` from 
     (
     select m.*, c.NAME as CORP_NAME 
     from MAIL_LOG as m, CORP as c 
      where 
           m.SEND_DATE >= '$term_from'
                  and
           m.SEND_DATE <= '$term_end'
     ) t
group by t.SEND_DATE;
于 2012-06-27T07:26:09.573 に答える