Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to write a 10G model clause for this

user517698Jun 14 2009 — edited Jun 17 2009
Hi ,

I am using Oracle 10G and i am trying to use the MODEL clause to cater for the following logics

data :


Row MCH_ID Date Failure_reason Working_hour(hrs) Working%
1 1 6/1/2009 8 0
2 1 6/2/2009 8 8
3 1 6/3/2009 8 16
4 1 6/4/2009 8 24
5 1 6/5/2009 Hydraulic 0 32
6 1 6/6/2009 Hydraulic 0 0
7 1 6/7/2009 8 0
8 1 6/8/2009 8 8
9 1 6/9/2009 8 16


Logics :
1 - 1st row will be 0 for working% & failure%
2 - if machine is working the next day , working% will add 8 hours
3 - if machine is down then the next day, the working% will be reset to 0%



pls advise

tks & rgds

Edited by: user517698 on Jun 14, 2009 7:02 PM

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 15 2009
Added on Jun 14 2009
14 comments
2,839 views