Hello Folks,
Need your help to build logic for the below requirement.
We have a requirement where we need to fetch the record posted after every 24 hours from the first record time stamp.
details about the requirement:
1) Take the first record for each order_number and corresponding time stamp.
2) take the record posted for the same order number after 24 hours.
3) take the record posted after after 24 hours based on the time stamp from 2nd record.
Below is the sample data set.
RECORD_NUMBER | CREATED_DATE |
567546 | 2015-07-28 10:45:24 |
567546 | 2015-07-28 14:13:45 |
567546 | 2015-07-28 22:53:19 |
567546 | 2015-07-29 08:34:39 |
567546 | 2015-07-29 17:13:26 |
567597 | 2015-07-26 11:34:29 |
567597 | 2015-07-27 10:45:32 |
567597 | 2015-07-28 13:12:43 |
567597 | 2015-07-29 18:39:51 |
The result should be like below.
RECORD_NUMBER | CREATED_DATE |
567546 | 2015-07-28 10:45:24 |
567546 | 2015-07-29 17:13:26 |
567597 | 2015-07-26 11:34:29 |
567597 | 2015-07-28 13:12:43 |
567597 | 2015-07-29 18:39:51 |
The records should be grouped based on record_number.
Regards,
Venkat N.