I have the following data, which is a call flow coming to our center and transmitted to a consultant (CSO).
CallID Sequence Action Location Input NextLocation 1135 0 CallStart NULL NULL NULL 1135 1 MenuStart EFTPosHelpDesk NULL NULL 1135 2 KeyPress EFTPosHelpDesk 3 TransferCSO 1135 3 TransferEntry EFTPosHelpDesk NULL NULL 1135 4 TransferFlag NULL NULL NULL 1135 5 AccessNum NULL NULL NULL 1135 6 Transfer NULL NULL NULL 1135 7 Hangup NULL NULL NULL
I use MS SQL Management Studio 2005 to retrieve the data, however the data itself is stored on the MS SQL 2000 server.
Literally millions of calls are recorded in the database, and I need to extract the CallID, where the client was transferred to CSO. The target data that tells me about the call was transmitted by the CSO exactly as follows:
@Sequence 2 -> NextLocation = 'TansferCSO' @Sequence 3 -> Action = 'TransferEntry' @Sequence 4 -> Action = 'TransferFlag' @Sequence 5 -> Action = 'AccessNum' @Sequence 6 -> Action = 'Transfer' @Sequence 7 -> Action = 'Hangup'
... and always in this sequence, but the numbering "Sequence" and "Location" will be different, because some calls can be performed on average 50 - 70 steps, and we have 100 IVR (locations).
I am new to SQL and I have tried using FETCH and IF / ELSE, but to no avail. ROW_NUMBER () does not work due to data residing on MS SQL2000 server.
Any examples or recommendations are appreciated.
source share