neronikita
Technical User
Hi, all. Please bear with me as I explain myself.
Can this be done:
I have a ticket database. Say Ticket1 has 50 tickets related to that ticket number. Then there may be additional tickets related to those tickets, which may or may not be related to Ticket1. Ultimately, I need a count of all distinct ticket numbers, but first I want to be sure I'm pulling them right.
So, I did
SELECT *
FROM ticketdatabase
WHERE relatedticket.linked = 'ticket1'
Now there is also a source field that I can use in place of Linked that pulled the same info. My problem is, it only pulls anything directly related to Ticket1. so if Ticket2 is related to Ticket1 it will count it, but if Ticket2 has 10 tickets related to it, it will NOT count those. To make it more confusing, in my trials, I used the problem tickets, but there could be related call tickets as well (problem - problem, problem-call, or call-call). What I need is to keep compiling lists of tickets related in anyway until I get a master list, then eliminate duplicates to get an accurate count.
For example:
Ticket1 =50
ticket2 =4
ticket3 =5
ticket4 =5
ticket5 =10
which makes it 74 distinct tickets total.
I hope I haven't made it too confusing. Please let me know if you need more information. Also, if there is a "name" for what I'm trying to do, that would be helpful too so I know what to look up.
Thanks!
Can this be done:
I have a ticket database. Say Ticket1 has 50 tickets related to that ticket number. Then there may be additional tickets related to those tickets, which may or may not be related to Ticket1. Ultimately, I need a count of all distinct ticket numbers, but first I want to be sure I'm pulling them right.
So, I did
SELECT *
FROM ticketdatabase
WHERE relatedticket.linked = 'ticket1'
Now there is also a source field that I can use in place of Linked that pulled the same info. My problem is, it only pulls anything directly related to Ticket1. so if Ticket2 is related to Ticket1 it will count it, but if Ticket2 has 10 tickets related to it, it will NOT count those. To make it more confusing, in my trials, I used the problem tickets, but there could be related call tickets as well (problem - problem, problem-call, or call-call). What I need is to keep compiling lists of tickets related in anyway until I get a master list, then eliminate duplicates to get an accurate count.
For example:
Ticket1 =50
ticket2 =4
ticket3 =5
ticket4 =5
ticket5 =10
which makes it 74 distinct tickets total.
I hope I haven't made it too confusing. Please let me know if you need more information. Also, if there is a "name" for what I'm trying to do, that would be helpful too so I know what to look up.
Thanks!