Sorry for an unclear question, my english isnt that good. So theres my query:
SELECT ticketID,
status,
COUNT(status) as count,
statusName,
assign
FROM ticket, department, status
WHERE ticket.department = 100
AND ticket.department = department.departID
AND ticket.status = status.statusID
GROUP BY statusName,assign
and this is the result:
| ticketID | count | statusName | assign |
|:----------|-----------:|:---------:|:-------:
| 1002 | 2 | open | NULL |
| 1020 | 1 | open | James |
| 1021 | 1 | open | Nick |
| 1015 | 1 | overdue | NULL |
My goal was to count ticket by their status, and if status='open' and assign = null then the status would change to 'unassigned', i need a better solution or just a way to merge the result where 'James' and 'Nick' to be one, as i only need to know whether the ticket is assigned or not.