select SUBSTR(timekey,1,10) as tk,SUM(num) as nn
from owntable
where SUBSTR(TIME_KEY,1,8) = 'year' & 'month' & 'day'
GROUP BY SUBSTR(timekey,1,10);这个是asp里直接用的查询,那个 'year' & 'month' & 'day'代表3个查询关键字的意思,数据库中的timekey包括年、月、日、时间、时区,所以要和在一起查谢谢各位帮帮忙~~~~~
from owntable
where SUBSTR(TIME_KEY,1,8) = 'year' & 'month' & 'day'
GROUP BY SUBSTR(timekey,1,10);这个是asp里直接用的查询,那个 'year' & 'month' & 'day'代表3个查询关键字的意思,数据库中的timekey包括年、月、日、时间、时区,所以要和在一起查谢谢各位帮帮忙~~~~~
select SUBSTR(timekey,1,10) as tk,SUM(hujiaoshu) as nn
from owntable
where SUBSTR(TIME_KEY,1,8) = 'year' & 'month' & 'day'
GROUP BY SUBSTR(timekey,1,10);
这段是我需要的字段,是表中的一部分,而且每个都是计算值,怎么做呢?谢谢了:)
(
select to_char(to_date('&年'||'&月'||'&日','yyyymmdd')+(rownum-1)/24,'hh24:mi') hourid from
user_tables
where rownum<25
) a,
(
select SUBSTR(timekey,9,10) as tk,SUM(hujiaoshu) as nn
from owntable
where SUBSTR(TIME_KEY,1,8) = 'year' & 'month' & 'day'
GROUP BY SUBSTR(timekey,9,10);
) b
where a.hourid=b.tk(+);就是这种意思,具体的你要到你的程序中去调
(
select to_char(to_date('2003'||'12'||'03','yyyymmdd')+(rownum-1)/24,'hh24:mi') hourid
from table
where rownum<25
) a,
(
select SUBSTR(TIME_KEY,1,10) AS TIMEKEYR,SUM(N_ABANDONED) AS NABANDONED
from table
where SUBSTR(TIME_KEY,1,8) like '20031203%'
GROUP BY SUBSTR(TIME_KEY,1,10)
) b
where a.hourid = b.TIMEKEYR(+);为何没有数据??这个对么?这天肯定有数据的
(
select to_char(to_date('2003'||'12'||'03','yyyymmdd')+(rownum-1)/24,'hh24') hourid
from table
where rownum<25
) a,
(
select SUBSTR(TIME_KEY,1,10) AS TIMEKEYR,SUM(N_ABANDONED) AS NABANDONED
from table
where SUBSTR(TIME_KEY,1,8) like '20031203%'
GROUP BY SUBSTR(TIME_KEY,1,10)
) b
where a.hourid = b.TIMEKEYR(+);这样呢?
(
select to_char(to_date('2003'||'12'||'03','yyyymmdd')+(rownum-1)/24,'yyyymmddhh24') hourid
from gendmt.R_ROUTEPOINT_HOUR
where rownum<25
) a,
(
select SUBSTR(TIME_KEY,1,10) AS TIMEKEYR,SUM(N_ABANDONED) AS NABANDONED,SUM(T_ABANDONED) AS TABANDONED,SUM(N_ANSWERED) AS NANSWERED,SUM(N_ENTERED) AS NENTERED
from gendmt.R_ROUTEPOINT_HOUR
-- where SUBSTR(TIME_KEY,1,8) like '20031203%'
GROUP BY SUBSTR(TIME_KEY,1,10)
) b
where a.hourid = b.TIMEKEYR(+);
已解决,非常感谢:)
请问一下那个(+)什么意思?