I have table and query like this: SQLFIDDLE
SELECT P.*, GROUP_CONCAT(`trait_name` SEPARATOR \', \') AS traits, GROUP_CONCAT(`filter_name` SEPAR