This is what I finially got to work. Is there a better way to do this? I'll add a few more details to explain why I have some of the stuff at the end. Oh, and I'm using MySQL v4.1.12 so I do have subqueries.
SELECT p.id, p.category, CONCAT_WS('.', IFNULL(p.major, 0)...