More than one record in the same interval
More than one record in the same interval
(OP)
Hello,
I have a table that defines wich person is using a DB user at a time:
DB_USER ID_NAME LOGIN LOGOFF
USER1 Ana 27-10-2012 18:10:05 27-10-2012 18:18:05
USER1 John 27-10-2012 18:18:06 27-10-2012 18:28:05
USER1 Greg 27-10-2012 18:20:09 27-10-2012 18:25:05
How can I find out if more than one person was using the same DB user at that interval of time? I know that in this example it should return the following:
DB_USER ID_NAME Date
USER1 John 27-10-2012
USER1 Greg 27-10-2012
Can you help me?
Thanks
I have a table that defines wich person is using a DB user at a time:
DB_USER ID_NAME LOGIN LOGOFF
USER1 Ana 27-10-2012 18:10:05 27-10-2012 18:18:05
USER1 John 27-10-2012 18:18:06 27-10-2012 18:28:05
USER1 Greg 27-10-2012 18:20:09 27-10-2012 18:25:05
How can I find out if more than one person was using the same DB user at that interval of time? I know that in this example it should return the following:
DB_USER ID_NAME Date
USER1 John 27-10-2012
USER1 Greg 27-10-2012
Can you help me?
Thanks
RE: More than one record in the same interval
funtions too - which will help you solve this. Alternatively there is an undocumented Oracle SQL function called overlaps which again may be of use, although I wouldn't base any production tasks on it.
In order to understand recursion, you must first understand recursion.
RE: More than one record in the same interval
Given your data:
CODE
...there are several ways you can solve your need. Here is one way:
CODE
Let us know if this is satisfactory and if you have additional questions.
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel."
RE: More than one record in the same interval
It worked. Thanks for all your help.