[snip] Are you satisfied? :) [/snip] Alexander,
Thanks for the insight, yes I am satisfied! :) Did you see my solution with the IF statement in the SQL? select foo, if(bar = 'A', count(*), 0) as A, if(bar = 'B', count(*), 0) as B, if(bar = 'C', count(*), 0) as C from tblFOOBAR group by foo Gives you +-----+---+---+---+ | foo | A | B | C | +-----+---+---+---+ | d1 | 1 | 3 | 0 | | d2 | 1 | 6 | 2 | | d3 | 1 | 0 | 2 | +-----+---+---+---+ Easily placed into Excel with a single SQL query from PHP Thanks! Jay Blanchard --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php