$query = 
"SELECT ad_crtv_id, goods_cd, goods_nm, goods_feature_nm, ".
"       count(ad_send_job_id) AS clk_cnts, ".
"       count(distinct send_member_id || 'a' || ad_crtv_id) AS clk_uniq_cnts, ". 
"       count(distinct send_member_id) AS clk_member_cnts ". 
"  FROM clk_log ".
" WHERE ad_send_job_id = :mail_send_job_id ".
"   AND add_dt >= :sum_start_dt ".
"   AND add_dt <= :sum_end_dt ".
" GROUP BY ad_crtv_id, goods_cd, goods_nm, goods_feature_nm ";

解决方案 »

  1.   

    谁能帮我解释下这条语句是什么意思?那个 count(distinct send_member_id ¦ ¦ 'a' ¦ ¦ ad_crtv_id) AS clk_uniq_cnts是什么意思?
      

  2.   

    count(distinct send_member_id ¦ ¦ 'a' ¦ ¦ ad_crtv_id) 
    中间的是逻辑或,因为有常量'a' 所以返回1 感觉没什么更多的意义了。
      

  3.   

    oR 
      
    || 
    逻辑或。如果任何一个参数不是0并且不NULL,返回1。