convert要用to_char 如: select cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日") as starttm ,count(cs11.ctname) num,tfno from callcount,cs11 where callcount.coper=cs11.coper and starttm>=to_date('2004-1-7 00:00:00','yyyy-mm-dd hh24:mi:ss') and starttm<=to_date('2004-1-7 23:59:59','yyyy-mm-dd hh24:mi:ss') group by cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"), tfno
select csll.ctname,to_char(starttm,'yyyy')||'年',to_char(starttm,'mm')||'月',to_char(starttm,'dd')||'日' starttm,count(1) num,tfno from callcont,csll where callcount.coper=cs11.coper and starttm>=to_date('2004-1-7 00:00:00','yyyy-mm-dd hh24:mi:ss') and starttm<=to_date('2004-1-7 23:59:59','yyyy-mm-dd hh24:mi:ss') group by csll.ctname,to_char(starttm,'yyyy')||'年',to_char(starttm,'mm')||'月',to_char(starttm,'dd')||'日' starttm,count(1) num,tfno
少了单引号: select cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"') as starttm ,count(cs11.ctname) num,tfno from callcount,cs11 where callcount.coper=cs11.coper and starttm>=to_date('2004-1-7 00:00:00','yyyy-mm-dd hh24:mi:ss') and starttm<=to_date('2004-1-7 23:59:59','yyyy-mm-dd hh24:mi:ss') group by cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"), tfno
如:
select cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日") as starttm ,count(cs11.ctname) num,tfno from callcount,cs11
where callcount.coper=cs11.coper
and starttm>=to_date('2004-1-7 00:00:00','yyyy-mm-dd hh24:mi:ss')
and starttm<=to_date('2004-1-7 23:59:59','yyyy-mm-dd hh24:mi:ss')
group by cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"), tfno
select cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"') as starttm ,count(cs11.ctname) num,tfno from callcount,cs11
where callcount.coper=cs11.coper
and starttm>=to_date('2004-1-7 00:00:00','yyyy-mm-dd hh24:mi:ss')
and starttm<=to_date('2004-1-7 23:59:59','yyyy-mm-dd hh24:mi:ss')
group by cs11.ctname, to_char(starttm, 'yyyy"年"mm"月"dd"日"), tfno