select ct.CallerNum from (select To_date(Substr(calltime, 1, 8),'yyyymmdd') as ct,CallerNum from "CC_AgentRecord" t) tt  group by CT

解决方案 »

  1.   

    select  To_date(Substr(calltime, 1, 8),'yyyymmdd') as ct,CallerNum from "CC_AgentRecord" t  
    group by To_date(Substr(calltime, 1, 8),'yyyymmdd')
      

  2.   

    group by 里面不能用别名,需要把别名的实际表达式写全。
    select  To_date(Substr(calltime, 1, 8),'yyyymmdd') as ct,CallerNum from "CC_AgentRecord" t  group by To_date(Substr(calltime, 1, 8),'yyyymmdd')