I have an ITEMS table. It maintains the record of all items which are in inventory.
The columns in the table are
Item_No, Time_Processed, Item_status.
All items come in a queue and get processed within a minute
So the Item_Status of items change from "Processing"
to "Completed"
Both these records are separated exactly by one minute of Time_Processed
That is , if for example an item with Item_No 100
is having Item_Status of "Processing" at 10:30:00AM (Time_Processed) , It would have an Item_status of "Completed" at 10:31:00AM .
The records would be like this in ITEMS table
Item_No Time_Processed Item_status
------------------------------------------------------
100 10:30:00AM Processing
100 10:31:00AM Completed
200 11:30:00AM Processing
200 11:31:00AM Completed
I would like to find out all the records( Same Item_No) which are separated by one minute of Time_Processed ,
and whose status changed from Processing to Completed
Could some one please suggest me a Query
Thanks
The columns in the table are
Item_No, Time_Processed, Item_status.
All items come in a queue and get processed within a minute
So the Item_Status of items change from "Processing"
to "Completed"
Both these records are separated exactly by one minute of Time_Processed
That is , if for example an item with Item_No 100
is having Item_Status of "Processing" at 10:30:00AM (Time_Processed) , It would have an Item_status of "Completed" at 10:31:00AM .
The records would be like this in ITEMS table
Item_No Time_Processed Item_status
------------------------------------------------------
100 10:30:00AM Processing
100 10:31:00AM Completed
200 11:30:00AM Processing
200 11:31:00AM Completed
I would like to find out all the records( Same Item_No) which are separated by one minute of Time_Processed ,
and whose status changed from Processing to Completed
Could some one please suggest me a Query
Thanks