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!

FUZZY TME and DATE JOIN.

DaveyBJan 14 2009 — edited Jan 14 2009
I have two tables its a one to many relationship from TableA to TableB.

What I am wanting to know is which time is the closest in Table_B to the time in comparison to Table_A based upon the UID.

I have documented two examples tables as stated below and an example output. I know this at first glance appears arbitary but its an actual problem on two tables I am working on. It appears to be some form of clock drift.

Thanks

Table_A
UID Date_Time_A
1111 14/01/2009 08:00:01
1112 14/01/2009 09:05:32


Table_B
UID Date_Time_B
1111 14/01/2009 08:00:00
1111 14/01/2009 08:03:01
1111 14/01/2009 08:10:02
1112 14/01/2009 09:04:00
1112 14/01/2009 09:05:30
1112 14/01/2009 09:06:00

OUTPUT
UID Date_Time_A Date_Time_B
1111 14/01/2009 08:00:01 1111 14/01/2009 08:00:00
1112 14/01/2009 09:05:32 1112 14/01/2009 09:05:30
This post has been answered by Frank Kulash on Jan 14 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2009
Added on Jan 14 2009
2 comments
347 views