Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Fetch the first record with 24 hr interval based on first record timestamp

$
0
0

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_NUMBERCREATED_DATE
5675462015-07-28 10:45:24
5675462015-07-28 14:13:45
5675462015-07-28 22:53:19
5675462015-07-29 08:34:39
5675462015-07-29 17:13:26
5675972015-07-26 11:34:29
5675972015-07-27 10:45:32
5675972015-07-28 13:12:43
5675972015-07-29 18:39:51

 

The result should be like below.

 

RECORD_NUMBERCREATED_DATE
5675462015-07-28 10:45:24
5675462015-07-29 17:13:26
5675972015-07-26 11:34:29
5675972015-07-28 13:12:43
5675972015-07-29 18:39:51

 

The records should be grouped based on record_number.

 

Regards,

Venkat N.


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>