Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |event_id|call_id|event_type |service|...
- |--------|-------|----------------|-------|---
- | 1| 1|Call Started |null |
- | 2| 1|Recorded Message|null |
- | 3| 1|Call at IVR |null |
- | 4| 1|Agent Ringing |Sales |
- | 5| 1|Agent Answers |Sales |
- | 6| 2|Call Started |null |
- | 7| 2|Recorded Message|null |
- | 8| 2|Call at IVR |null |
- | 9| 1|Disconnected |null |
- | 10| 1|Call Ended |null |
- | 11| 3|Call Started |null |
- | 12| 3|Recorded Message|null |
- | 13| 2|Agent Ringing |Support|
- | 14| 3|Agent Ringing |Sales |
- | 15| 2|Agent Answers |Support|
- | 16| 3|Agent Answers |Sales |
- | 17| 3|Call Hold |null |
- | 18| 2|Disconnected |null |
- | 19| 2|Call Ended |null |
- | 20| 3|Call Retrieved |Sales |
- | 21| 3|Disconnected |null |
- | 22| 3|Call Ended |null |
- SELECT event_id
- FROM events
- GROUP BY call_id
- HAVING (SELECT COUNT(*) FROM ***this_group*** WHERE service='Sales') > 0
- |event_id|
- |--------|
- | 1|
- | 2|
- | 3|
- | 4|
- | 5|
- | 9|
- | 10|
- | 11|
- | 12|
- | 13|
- | 16|
- | 17|
- | 20|
- | 21|
- | 22|
Add Comment
Please, Sign In to add comment