nedy_03
02-07-2008, 03:46 AM
Hello,
I am facing this situation. I have a table called "CALLTRACE". The columns are:
- CalltraceID
- QueueID
- AgentID
- CloseTime
- CallCode
- DialedNO
- LeadID
To a LeadID may corispond more then one DialedNo,CloseTime, DialedNo,AgentID
I would need a query that returns the LeadID with the latest ClodeTime. For that I used this sintax:
SELECT leadid,max(calltrace.closetime)as Last_time
FROM calltrace
WHERE queueid=8
GROUPBY leadid
Orderby'Last_time'
But I would need to add to every row the corisponding DialedNo, CallCode and AgentID.
Cloud someone help me with that issue pls?!!
Thx,
Nedy
I am facing this situation. I have a table called "CALLTRACE". The columns are:
- CalltraceID
- QueueID
- AgentID
- CloseTime
- CallCode
- DialedNO
- LeadID
To a LeadID may corispond more then one DialedNo,CloseTime, DialedNo,AgentID
I would need a query that returns the LeadID with the latest ClodeTime. For that I used this sintax:
SELECT leadid,max(calltrace.closetime)as Last_time
FROM calltrace
WHERE queueid=8
GROUPBY leadid
Orderby'Last_time'
But I would need to add to every row the corisponding DialedNo, CallCode and AgentID.
Cloud someone help me with that issue pls?!!
Thx,
Nedy