Say I have a table like this:
emp_id work_site expenses
001 atlanta $500
001 atlanta $750
002 boston $750
002 chicago $250
003 chicago $500
003 chicago $500
And now I want to group expenses by emp_id and unique city, in this format:
emp_id atlanta boston chicago
001 $1250 $0 $0
002 $0 $750 $250
003 $0 $0 $1000
What's the best way to do this in mysql or PHP?