Am 16.04.2014 02:36, schrieb Gerald Young:
...

select  q.name queue, count(t.id) number from ticket t left join queue q on q.id=t.queue_id left join ticket_state ts on ts.id = t.ticket_state_id group by q.name

number of tickets locked and unlocked in each queue:

select  q.name queue, sum(if(t.ticket_lock_id =1, 1, 0)) unlocked, sum(if(t.ticket_lock_id = 2, 1, 0)) locked from ticket t left join queue q on q.id=t.queue_id left join ticket_state ts on ts.id = t.ticket_state_id group by q.name

(yeah, you're not going to find *that* one easily in a list). 

Thank you Gerald for sharing!
(this is also ment for many other answers you gave in this List)

regards Fritz