Group by query for track_projects