I read a few things already here and also used Google to find an answer to my question but I did not find something that helps me. I hope someone can give me an answer to my question.
I do have a database with a table called "tickets". Now if a user creates a new ticket, an entry to the database will be made. If an admin now gives an answer a new row in the table will be created, with the same "ticketnumber". This looks like this screenshot here:

First row is a newly created ticket and second row is an answer from an admin! Now I need a query to get the following information: Response Time from Admin! I need to know how long the difference is between stamp_closed and stamp_opened but the response time must be from the admin, that is my problem because in admin´s row the stamp_opened is not logged.
How can I create SELECT-query to get: pers_id from Admin, stamp_opened from Admin and stamp_closed from User?
This is what I tried so far:
SELECT ticket.pers_id, ticket.stamp_created as starttime, ticket.stamp_closed as endtime, count(ticket.pers_id) as cnt, user.firstname, user.lastname, (sum(ticket.stamp_closed)-sum(ticket.stamp_created)) as average
FROM tickets ticket
inner join userlist user on ticket.pers_id=user.pers_id
where ticket.ticketnumber=54094
Problem is that I get the user´s pers_id and user´s stamp_closed and not admin´s pers_id and admin´s stamp_closed!
Hopefully someone can help me out!
Thanks in advance!
FROM tickets t inner join tickets tAnswer on t.ticketnubmer = tanswer.ticketnumber and t.stamp_reply =0 and tansewr.stamp_reply <> 0