按列求积

A表以SECCODEDATE为主键，有如下纪录：
SECCODE DATE FACTOR
6000 2007-7-18 0.9958
6000 2008-4-24 0.7656
6000 2009-6-9 0.7090
6000 2010-6-10 0.7632
6000 2011-6-3 0.7600
6000 2012-6-26 0.9640

B

SECCODE DATE PRICE
6000 2008-4-01 15
6000 2008-4-12 16
6000 2009-4-12 17
6000 2011-4-12 13
6000 2012-4-12 16

6000 2009-6-9 0.7090
6000 2010-6-10 0.7632
6000 2011-6-3 0.7600
6000 2012-6-26 0.9640
4

(1)　a0a1b0，則有唯一的實數x滿足axb。此時x稱為“a為底數，b的對
，並記做xloga b，其中b叫做真數a叫做底數有時我們也把loga b叫做對數式
(2)
xloga b axb（即ab）。

create table a (

seccode number(12),

a_date date,

factor number(6,4)

);

create table b (

seccode number(12),

b_date date,

price number(12)

);

insert into a values(6000,to_date('2007-07-18','yyyy-mm-dd'),0.9958);

insert into a values(6000,to_date('2008-04-24','yyyy-mm-dd'),0.7656);

insert into a values(6000,to_date('2009-06-09','yyyy-mm-dd'),0.7090);

insert into a values(6000,to_date('2010-06-10','yyyy-mm-dd'),0.7632);

insert into a values(6000,to_date('2011-06-03','yyyy-mm-dd'),0.7600);

insert into a values(6000,to_date('2012-06-26','yyyy-mm-dd'),0.9640);

insert into b values(6000,to_date('2008-04-01','yyyy-mm-dd'),15);

insert into b values(6000,to_date('2008-04-12','yyyy-mm-dd'),16);

insert into b values(6000,to_date('2009-04-12','yyyy-mm-dd'),17);

insert into b values(6000,to_date('2011-04-12','yyyy-mm-dd'),13);

insert into b values(6000,to_date('2012-04-12','yyyy-mm-dd'),16);

select b.price * (select ?

from a

where a.a_date > b.b_date)

from b;

select b.price * (select power(10, sum(log(10, a.factor)))

from a

where a.a_date > b.b_date)

from b;

select trunc(b.price * (select power(10, sum(log(10, a.factor)))

from a

where a.a_date > b.b_date),2) as result

from b;

• 博文量
16
• 访问量
19729