不大明白,不过你可以把业务处理的sql 语句写成存储过程。然后程序中直接调用存储过程来实现某个业务。置于存储过程的相关知识,你可以在google 中查找一下。资料还是很多的。
你的描述太笼统了,不明白。页面功能对数据库操作,不过就是增删改查,至于sql语句不过就是select、insert updata delete 语句
CRUD
select t5.v01000,
(select avg(seq)
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t8
where t8.v01000 = t5.v01000
group by t8.v01000),
t5.v04002 || '-' || t5.v04003,
t6.v04002 || '-' || t6.v04003,
(select avg(seq) -
(select avg(seq)
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t8
where t8.v01000 = t7.v01000
group by t8.v01000)
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t7
where t7.v01000 = t5.v01000
group by t7.v01000)
from (select distinct t2.v01000 as v01000, t2.v04002, t2.v04003
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t2
where t2.seq in
(select max(t1.seq)
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t1
group by t1.v01000)) t5
left join (select distinct t3.v01000 as v01000, t3.v04002, t3.v04003
from (select t.*,
to_char(to_char(t.event_date, 'DDD'), '999') as seq
from T_LTCD_FROSTY_HIST t) t3
where t3.seq in
(select min(t4.seq)
from (select t.*,
to_char(to_char(t.event_date, 'DDD'),
'999') as seq
from T_LTCD_FROSTY_HIST t) t4
group by t4.v01000)) t6
on t5.v01000 = t6.v01000