Wow now I am stumped with the requirments.
I have a subset of data using oracle 9.2
Date name SRT Status ValueINT
03-Jun-05 Jim C 123 WIP 0
03-Jun-05 Dino B 123 WIP 0
03-Jun-05 Jim C 123 Closed 1
03-Jun-05 Sal M 456 WIP 0
03-Jun-05 Dave G 456 WIP 0
03-Jun-05 Sal M 456 Closed 1
What I need to do, hopefully in a case statement or even a function(as my query is a bunch of selects and case statements), is look for all records where the field heading status is 'closed'. When you find the 'closed' status if name heading in that record is the same as the name in the first record of that SRT(look closely how I ordered the SRT numbers) then give the value of 1 in another column(ValueInt). Hope that makes sense. I am trying to compare values from the last record in an ordered by SRT, date to the first record in the order. The order by cannot change in this query.
Therefore looking for the first closed in the recordset I can see that it occurs in the following record.
03-Jun-05 Jim C 123 Closed 1
I will then compare this record to the first record of that SRT group(123) and I will find
03-Jun-05 Jim C 123 WIP 0
Well the name in this record is the same as the name in the closed record so therefore I will increment the field ValueInt for the closed record to 1. I will then proceed to look at SRT 456 and look for the closed status and compare it to the first record of SRT 456...etc etc
If someone can figure this out your a genious. Thanks again.
I have a subset of data using oracle 9.2
Date name SRT Status ValueINT
03-Jun-05 Jim C 123 WIP 0
03-Jun-05 Dino B 123 WIP 0
03-Jun-05 Jim C 123 Closed 1
03-Jun-05 Sal M 456 WIP 0
03-Jun-05 Dave G 456 WIP 0
03-Jun-05 Sal M 456 Closed 1
What I need to do, hopefully in a case statement or even a function(as my query is a bunch of selects and case statements), is look for all records where the field heading status is 'closed'. When you find the 'closed' status if name heading in that record is the same as the name in the first record of that SRT(look closely how I ordered the SRT numbers) then give the value of 1 in another column(ValueInt). Hope that makes sense. I am trying to compare values from the last record in an ordered by SRT, date to the first record in the order. The order by cannot change in this query.
Therefore looking for the first closed in the recordset I can see that it occurs in the following record.
03-Jun-05 Jim C 123 Closed 1
I will then compare this record to the first record of that SRT group(123) and I will find
03-Jun-05 Jim C 123 WIP 0
Well the name in this record is the same as the name in the closed record so therefore I will increment the field ValueInt for the closed record to 1. I will then proceed to look at SRT 456 and look for the closed status and compare it to the first record of SRT 456...etc etc
If someone can figure this out your a genious. Thanks again.