Ticket schema
From MyNotes
| TICKET_NUMBER | STATUS | LAST_NAME | FIRST_NAME | RECEIVED_HOW |
|---|---|---|---|---|
| 101 | Closed | Smith | Joe | Phone |
| 102 | Closed | Smith | Jane | Phone |
| 103 | Closed | Smith | Bob | Phone |
| CASE_HISTORY_ID | TICKET_NUMBER | ACTION | NAME |
|---|---|---|---|
| 1 | 101 | New | Peggy Sue |
| 2 | 101 | Assigned | Peggy Sue |
| 3 | 102 | New | John Smith |
| 4 | 102 | Modified | John Smith |
| 5 | 102 | Assigned | Peggy Sue |
| 6 | 103 | New | Bill Smith |
| 7 | 103 | Assigned | Bill Smith |
Tickets 101 and 103 where marked as "Closed" when initially created because the problem was resolved immediately. Ticket 102 took some extra time to solve so it went beyond the initial phone call.
My object is to count the number of calls that were resolved immediately. To do this I need to count the number of tickets that are "Closed", and were received by "Phone", in t1 that only have two rows associated with them in t2.
