日期:2014-05-16 浏览次数:20548 次
SELECT COUNT(DISTINCT(c.caller_nbr)) AS emp_use_count FROM tab_pub_calllog c WHERE TO_CHAR(c.end_time,'yyyymm')='201212'
SELECT COUNT(DISTINCT(emp_use_count)) FROM ( SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121201) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121202) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121203) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121204) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121205) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121206) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121207) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121208) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121209) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121210) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121211) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121212) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121213) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121214) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121215) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121216) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121217) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121218) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121219) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121220) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121221) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121222) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121223) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121224) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121225) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121226) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121227) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121228) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121229) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121230) c UNION ALL SELECT DISTINCT(c.caller_nbr) AS emp_use_count FROM tab_pub_calllog_his PARTITION(p_20121231) c )