Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Find similar, sequential rows in a table

$
0
0
hi,
I'm trying to process a table of phone records but, in particular, looking to identify calls made to the same number in a row. For example:

phone_calls()
-callingnumber
-callednumber
-callduration
-callID
-calltime

suppose a person called from the same phone (calling number) to the same number 3 times in a row (duration 3 sec, 5 sec, 1 sec) each. I'd like to be able to identify that type of pattern separate from say them calling that number every day, hour, etc.

The phone_calls, however, can have many other calls all interweaved between these 3 calls (other people making calls).

Basically, I know a time range after which I would not consider them sequential.

I was thinking some way an anti-distinct (show me rows which are similar) knowing the rules are that the time between calls (calltime2 - calltime1 and calltime 3 - calltime 2) has to be say < 5 seconds.

Any guidance?

Viewing all articles
Browse latest Browse all 13329

Trending Articles