Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Extremely Challenging SQL

376519Jul 27 2007 — edited Jul 29 2007

Hello

I have a table that records Commands sent from “Commanding Objects” to “Listening Objects”. I need to find when Commands where sent to the same “Listening Object” from more then one “Commanding Object” within S number of seconds.

This is what the Commands table looks like:

CMD_UID    CMDING_OBJECT    LSNING_OBJECT    CMD_TIME (TIMESTAMP)
 1                AAA           XXX           3:00:00
 2                AAA           XXX           3:00:09
 3                AAA           YYY           3:00:10
 4                BBB           XXX           3:00:12
 6                AAA           XXX           3:00:17
 8                BBB           YYY           3:00:21
 9                CCC           ZZZ           3:00:22
10                CCC           YYY           3:00:30
11                AAA           XXX           3:00:33

This is what the Results should look like with S = 10:

CONTENTION_SET    CMD_UID    CMD_TIME_DELTA_SECONDS
 1                2                0
 1                4                3
 1                6                8                                         
 2                8                0
 2               10                9

I sure would appreciate any help!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2007
Added on Jul 27 2007
16 comments
994 views