(datadate between 20050721 and 20050721)
------
(datadate between to_date('20050721','yyyymmdd') and to_date('20050721','yyyymmdd'))

解决方案 »

  1.   

    select count(distinct devid) as succnum from (select devid from ana_devcomm_report_view where commcount>0 and (datadate between 20050721 and 20050721) and cityid=13 and countyid=001 group by devid having (sum(succ)/sum(commcount)*100<60)) datadata between 20050721 and 20050721 是什么意思? 前后值都一样countyid = 001 直接写1不行吗? 如果是字符的话就是 countyid = '001'sum(succ)/sum(commcount)*100<60 这个执行的前后顺序我是不太清楚,但是我宁愿给这句话多加两个框框having((sum(succ)/(sum(commcount)*100))<60)