Hey
Can some one help reduce this sql query to only take one last logon row each agent, so that i dont get a long data row.
SELECT dAgentPerformanceStat.Timestamp, dAgentPerformanceStat.AgentLogin, dAgentPerformanceStat.AgentSurName, dAgentPerformanceStat.AgentGivenName, dAgentPerformanceStat.ACDCallsAnswered, dAgentPerformanceStat.ACDCallsConfToCDN, dAgentPerformanceStat.ACDCallsConfToDN, dAgentPerformanceStat.ACDCallsConfToIncalls, dAgentPerformanceStat.ACDCallsConfToOther, dAgentPerformanceStat.ACDCallsTalkTime, dAgentPerformanceStat.ACDCallsTransferredToCDN, dAgentPerformanceStat.ACDCallsTransferredToDN, dAgentPerformanceStat.ACDCallsTransferredToIncalls, dAgentPerformanceStat.ACDCallsTransferredToOther, dAgentPerformanceStat.BreakTime, dAgentPerformanceStat.BusyOnDNTime, dAgentPerformanceStat.BusyMiscTime, dAgentPerformanceStat.CallsAnswered, dAgentPerformanceStat.CallsOffered, dAgentPerformanceStat.CallsReturnedToQ, dAgentPerformanceStat.CallsReturnedToQDueToTimeout, dAgentPerformanceStat.CDNCallsConfToCDN, dAgentPerformanceStat.CDNCallsConfToDN, dAgentPerformanceStat.CDNCallsConfToIncalls, dAgentPerformanceStat.CDNCallsConfToOther, dAgentPerformanceStat.CDNCallsTransferredToCDN, dAgentPerformanceStat.CDNCallsTransferredToDN, dAgentPerformanceStat.CDNCallsTransferredToIncalls, dAgentPerformanceStat.CDNCallsTransferredToOther, dAgentPerformanceStat.ConsultationTime, dAgentPerformanceStat.DNCallsConfToACDDN, dAgentPerformanceStat.DNCallsConfToCDN, dAgentPerformanceStat.DNCallsConfToDN, dAgentPerformanceStat.DNCallsConfToOther, dAgentPerformanceStat.DNCallsTransferredToACDDN, dAgentPerformanceStat.DNCallsTransferredToCDN, dAgentPerformanceStat.DNCallsTransferredToDN, dAgentPerformanceStat.DNCallsTransferredToOther, dAgentPerformanceStat.DNInExtCalls, dAgentPerformanceStat.DNInExtCallsTalkTime, dAgentPerformanceStat.DNInIntCalls, dAgentPerformanceStat.DNInIntCallsTalkTime, dAgentPerformanceStat.DNOutExtCalls, dAgentPerformanceStat.DNOutExtCallsTalkTime, dAgentPerformanceStat.DNOutIntCalls, dAgentPerformanceStat.DNOutIntCallsTalkTime, dAgentPerformanceStat.HoldTime, dAgentPerformanceStat.LoggedInTime, dAgentPerformanceStat.NACDCallsAnswered, dAgentPerformanceStat.NACDCallsTalkTime, dAgentPerformanceStat.NetworkCallsAnswered, dAgentPerformanceStat.NetworkCallsTalkTime, dAgentPerformanceStat.NotReadyTime, dAgentPerformanceStat.ReservedForCall, dAgentPerformanceStat.ReservedTime, dAgentPerformanceStat.RingTime, dAgentPerformanceStat.ShortCallsAnswered, dAgentPerformanceStat.TalkTime, dAgentPerformanceStat.WaitingTime, dAgentPerformanceStat.WalkawayTime, dAgentPerformanceStat.UserID, dAgentPerformanceStat.SupervisorUserID, dAgentPerformanceStat.DNInExtCallsHoldTime, dAgentPerformanceStat.DNInIntCallsHoldTime, dAgentPerformanceStat.DNOutExtCallsHoldTime, dAgentPerformanceStat.DNOutIntCallsHoldTime
FROM blue.dbo.dAgentPerformanceStat dAgentPerformanceStat
ORDER BY dAgentPerformanceStat.Timestamp DESC
Best Regards
KVS
Can some one help reduce this sql query to only take one last logon row each agent, so that i dont get a long data row.
SELECT dAgentPerformanceStat.Timestamp, dAgentPerformanceStat.AgentLogin, dAgentPerformanceStat.AgentSurName, dAgentPerformanceStat.AgentGivenName, dAgentPerformanceStat.ACDCallsAnswered, dAgentPerformanceStat.ACDCallsConfToCDN, dAgentPerformanceStat.ACDCallsConfToDN, dAgentPerformanceStat.ACDCallsConfToIncalls, dAgentPerformanceStat.ACDCallsConfToOther, dAgentPerformanceStat.ACDCallsTalkTime, dAgentPerformanceStat.ACDCallsTransferredToCDN, dAgentPerformanceStat.ACDCallsTransferredToDN, dAgentPerformanceStat.ACDCallsTransferredToIncalls, dAgentPerformanceStat.ACDCallsTransferredToOther, dAgentPerformanceStat.BreakTime, dAgentPerformanceStat.BusyOnDNTime, dAgentPerformanceStat.BusyMiscTime, dAgentPerformanceStat.CallsAnswered, dAgentPerformanceStat.CallsOffered, dAgentPerformanceStat.CallsReturnedToQ, dAgentPerformanceStat.CallsReturnedToQDueToTimeout, dAgentPerformanceStat.CDNCallsConfToCDN, dAgentPerformanceStat.CDNCallsConfToDN, dAgentPerformanceStat.CDNCallsConfToIncalls, dAgentPerformanceStat.CDNCallsConfToOther, dAgentPerformanceStat.CDNCallsTransferredToCDN, dAgentPerformanceStat.CDNCallsTransferredToDN, dAgentPerformanceStat.CDNCallsTransferredToIncalls, dAgentPerformanceStat.CDNCallsTransferredToOther, dAgentPerformanceStat.ConsultationTime, dAgentPerformanceStat.DNCallsConfToACDDN, dAgentPerformanceStat.DNCallsConfToCDN, dAgentPerformanceStat.DNCallsConfToDN, dAgentPerformanceStat.DNCallsConfToOther, dAgentPerformanceStat.DNCallsTransferredToACDDN, dAgentPerformanceStat.DNCallsTransferredToCDN, dAgentPerformanceStat.DNCallsTransferredToDN, dAgentPerformanceStat.DNCallsTransferredToOther, dAgentPerformanceStat.DNInExtCalls, dAgentPerformanceStat.DNInExtCallsTalkTime, dAgentPerformanceStat.DNInIntCalls, dAgentPerformanceStat.DNInIntCallsTalkTime, dAgentPerformanceStat.DNOutExtCalls, dAgentPerformanceStat.DNOutExtCallsTalkTime, dAgentPerformanceStat.DNOutIntCalls, dAgentPerformanceStat.DNOutIntCallsTalkTime, dAgentPerformanceStat.HoldTime, dAgentPerformanceStat.LoggedInTime, dAgentPerformanceStat.NACDCallsAnswered, dAgentPerformanceStat.NACDCallsTalkTime, dAgentPerformanceStat.NetworkCallsAnswered, dAgentPerformanceStat.NetworkCallsTalkTime, dAgentPerformanceStat.NotReadyTime, dAgentPerformanceStat.ReservedForCall, dAgentPerformanceStat.ReservedTime, dAgentPerformanceStat.RingTime, dAgentPerformanceStat.ShortCallsAnswered, dAgentPerformanceStat.TalkTime, dAgentPerformanceStat.WaitingTime, dAgentPerformanceStat.WalkawayTime, dAgentPerformanceStat.UserID, dAgentPerformanceStat.SupervisorUserID, dAgentPerformanceStat.DNInExtCallsHoldTime, dAgentPerformanceStat.DNInIntCallsHoldTime, dAgentPerformanceStat.DNOutExtCallsHoldTime, dAgentPerformanceStat.DNOutIntCallsHoldTime
FROM blue.dbo.dAgentPerformanceStat dAgentPerformanceStat
ORDER BY dAgentPerformanceStat.Timestamp DESC
Best Regards
KVS