I have two tables with structures below
table one
ββββββ¦ββββββββββββ¦ββββββββ¦βββ
β ID β Date β value β β
β βββββ¬ββββββββββββ¬ββββββββ¬βββ£
β 1 β 1/1/2015 β 234 β β
β 2 β 1/20/2015 β 267 β β
β 3 β 1/25/2015 β 270 β β
ββββββ©ββββββββββββ©ββββββββ©βββ
second table
ββββββββββββββββββββββββββ
β start_date β end date β
β βββββββββββββββββββββββββ£
β 1/1/2015 β 1/20/2015 β
β 1/20/2015 β 1/25/2015 β
ββββββββββββββββββββββββββ
My conclusion should be
ββββββββββββββββββββββββββ¦βββββββββββββ
β start_date β end date β difference β
β βββββββββββββββββββββββββ¬βββββββββββββ£
β 1/1/2015 β 1/20/2015 β 33 β
β 1/20/2015 β 1/25/2015 β 3 β
ββββββββββββββββββββββββββ©βββββββββββββ
, , ( ) , sql.
, .
,
select start_date, end_date, ((SELECT
table_one.value
FROM
table_one,
table_two
WHERE
table_one.date= table_two.end_date(+)
) - (
SELECT
table_one.value
FROM
table_one,
table_two
WHERE
table_one.date = table_two.start_date(+)
))from table_two,table_one where table_two.start_date(+)=table_one.date
ORA-01427 . ?