Home > database >  The stored procedure
The stored procedure

Time:10-06

Great god teach genuflect is begged!!!!!
First contact with oracle, the stored procedure was dying,,,
According to the number of different number add current want to every day, every day is the judgment of the day is the last day of this month, if is the last day of that month, according to the number add to this month's current data, judgment day is the last day of this year, according to the number add to this year's current data

Number time current parent number identifies a
100001 2016/7/11 13:02 0.1 1000 0
100001 2016/7/11 13:03 0.1 1000 0
100001 2016/7/11 13:04 0.1 1000 0
100001 2016/7/11 13:05 0.1 1000 0
100001 2016/7/11 13:06 0.1 1000 0
100001 2016/7/11 13:07 0.1 1000 0
100001 2016/7/11 13:08 0.1 1000 0
100001 2016/7/11 13:09 0.1 1000 0
100001 2016/7/11 "0.1 1000 0
100001 2016/7/11 then 0.1 1000 0
100001 2016/7/11 when 0.1 1000 0
100001 2016/7/11 0.1 1000 0
"100001 2016/7/11 remained 4.8 1000 0
100001 2016/7/11 13:15 5 1000 0
100001 2016/7/11:6.5 1000 0
100001 "2016/7/11 6.4 1000 0
100001 2016/7/11 13:18 6 1000 0
100001 2016/7/11 and 6 1000 0
100001 2016/7/11 all 6 1000 0
100002 2016/7/11 "6 1000 0
100003 2016/7/11 and 5.6 1000 0
100004 2016/7/11 but 5.8 1000 0
100005 cluster 5.6 the 2016/7/11 1000 0
100006 2016/7/11 5.6 while 1000 0
100006 2016/7/11 5.6 1000 0
"100006 2016/7/11 but 5.6 1000 0
100006 2016/7/11 13:28 5.6 1000 0
100006 2016/7/11 possession of 0, 1000
100006 2016/7/11 13:30 5.5 1000 0
100011 2016/7/11 times 5.5 1001 0
100011 2016/7/11 "0, 1001
100011 temptation 2016/7/11 5.5 1001 0
100021 2016/7/11 became 5.5 1002 0
100022 2016/7/11 "by 5.5, 1002

CodePudding user response:

Ask to see section
To transfer you to the oracle

CodePudding user response:


See function by trigger
Or in the written records stored procedure package this logic
The calculation of monthly written by other table

CodePudding user response:

refer to the second floor roy_88 response:
see function by trigger
Or in the written records stored procedure package this logic
The calculation of monthly written by other table
webmaster great god can help to write it,,, completely don't understand the

CodePudding user response:

 select Anderson d, a.r q, a. d. l, b.r q, b.d l, c.r q, c.d l from 
(select id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), 'yyyy) rq, sum (dl) dl,' FBH from TAB
Group by id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), 'yyyy)) a
Left the join
(select id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), 'yyyy - mm) rq, sum (dl) dl, Max (to_char (to_date (sj,' yyyy - mm - dd hh24: mi '), 'yyyy)) FBH from TAB
Group by id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), 'yyyy - mm))
bOn Anderson and a.r q=d d=b.i substr (b.r q, 1, 4)
Left the join
(select id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), '- dd yyyy - mm) rq, sum (dl) dl, Max (to_char (to_date (sj,' yyyy - mm - dd hh24: mi '), 'yyyy - mm)) FBH from TAB
Group by id, to_char (to_date (sj, 'yyyy - mm - dd hh24: mi'), '- dd yyyy - mm)) c
On Anderson and b.r q=d d=c.i substr (c.r q, 1, 7)
The order by id, a.r q, b.r q, c.r q

Don't know if you want the results
Time to number: id: sj: current dl father number: FBH logo: flag
  • Related