What\'s the best way of handling pivot tables in php/MySQL (or something to that effect)
I have a query that returns information as below
id eng
You can likely do this with a sub-query and then produce and aggregation of this data. Try something along the lines of this:
select week,
count(*) as total,
sum(technical) as technical,
sum(non_technical) as non_technical)
from(
select week,
case(type) when 'Technical' then 1 else 0 END as technical,
case(type) when 'Non-Technical' then 1 else 0 END as non_technical
) as data
GROUP BY week