vvhitekid2
Technical User
This should be an easy question for a seasoned Oracle person:
I have a system setup to record info about calls coming into our company. My simple table has 3 fields:
DATESTAMP (date)
ORIG (varchar) <- caller id of person calling
DEST (varchar) <- Internal ext person called
SELECT COUNT(1) FROM calldata WHERE (dest = ?) AND (DATESTAMP < sysdate - 1) AND (DATESTAMP > sysdate-8)")
This tells me how many calls an employee got last week. Now I need to modify this somehow to give the number of "unresolved" callers (how many people that talked to this person called ANYONE in the compay back within 24 hours after talking to employee?)
Is there a way to do this with just SQL, or will I have to setup arrays to store values? I know how to do it with loops and a few arrays, but it seems very inefficient. Can Oracle do better than a few nested for loops?
Thanks in advnace!
I have a system setup to record info about calls coming into our company. My simple table has 3 fields:
DATESTAMP (date)
ORIG (varchar) <- caller id of person calling
DEST (varchar) <- Internal ext person called
SELECT COUNT(1) FROM calldata WHERE (dest = ?) AND (DATESTAMP < sysdate - 1) AND (DATESTAMP > sysdate-8)")
This tells me how many calls an employee got last week. Now I need to modify this somehow to give the number of "unresolved" callers (how many people that talked to this person called ANYONE in the compay back within 24 hours after talking to employee?)
Is there a way to do this with just SQL, or will I have to setup arrays to store values? I know how to do it with loops and a few arrays, but it seems very inefficient. Can Oracle do better than a few nested for loops?
Thanks in advnace!