forex sql
select
max(point) max
,min(point) min
,(max(point) -min(point) ) diss
,'0'||substr((max(point) -min(point) ),0,5) diss2
,datetime
,to_char(to_date(datetime,'yyyy-mm-dd'),'day') day
from (
select t.point ,to_char(t.datatime,'yyyy-MM-dd') datetime
from mk_eurusd t
) tt
group by datetime
order by datetime desc;
-------------------------------------------------------------------------
select
max(ta.c1) max,
min(ta.c1) min,
( max(ta.c1)-min(ta.c1)) diss,
to_char(ta.datetime,'yyyy-MM-dd') datetime
from (
select tt1.datetime,tt1.day,tt1.c1 from (
select to_date(tt.datetime,'yyyy-MM-dd HH24:Mi:ss') datetime,
to_char(to_date(tt.datetime,'yyyy-MM-dd HH24:Mi:ss'),'day') day,tt.c1,tt.c2,tt.c3,tt.c4,tt.c5 from (
select t.c01 ||' '|| t.c02 datetime,t.c1,t.c2,t.c3,t.c4,t.c5 from f_gbpjpy t
) tt
) tt1
) ta group by to_char(ta.datetime,'yyyy-MM-dd');
-------------------------------------------------------------------------