I have an oracle database. If I run a query like
select Ticket,Priority from incident where assignment = 'Network Team'
select i.Ticket, i.Priority, a.Type, a.Desc from incident i join Activity a
on (i.Ticket = a.Ticket_no) where assignment = 'Network Team'
Ticket Priority Type Desc
1234 P1 Logged Ticket Logged
1234 P1 Assigned Ticket Assigned to Network Team
1234 P1 Priority Changed Ticket Priority Changed
2345 P2 Logged Ticket Logged
2345 P2 Contact Changed Contact Number Changed
2345 P2 Assigned Ticket Assigned to Network Team
The ticket row will definitely repeat.
Below is what I want to do and facing little problem.
1. I want to write a query which will give me Total Ticket Count, Ticket counts where activity type is like Contact Changed.
Total count Contact changed count
2. I want to write a query which will give me the records where activity type is like Contact Changed.
Ticket Priority Contact Chnaged Type Desc
2345 P2 Yes Contact Changed Contact Number Changed
Please guide me in right direction.