Staff Ticket Statistics SELECT B.nickname, count(A.id) as total from %%AGILE_DB_PREFIX%%ticket A join %%AGILE_DB_PREFIX%%staff B on A.staff_id=B.id A.site_id = %%DEFAULT_SITE%% GROUP BY nickname ORDER BY total DESC SELECT B.nickname, count(A.id) as total from %%AGILE_DB_PREFIX%%ticket A join %%AGILE_DB_PREFIX%%staff B on A.staff_id=B.id A.site_id = %%DEFAULT_SITE%% GROUP BY nickname ORDER BY total DESC 0 Staff nickname true true true Tickets total true SELECT from_unixtime(A.date_orig,"%Y-%u") as yearmonth, count(A.id) as total, B.nickname from %%AGILE_DB_PREFIX%%ticket A left join %%AGILE_DB_PREFIX%%staff B on A.staff_id=B.id A.site_id = %%DEFAULT_SITE%% GROUP BY yearmonth ORDER BY yearmonth ASC