Snippet Name: Make comma-separated list of strings Description: Build a comma-separated list of strings in mySQL. Comment: (none) Language: MYSQL Highlight Mode: MYSQL Last Modified: March 01st, 2009
Description: Build a comma-separated list of strings in mySQL.
SELECT cats.id AS cat_id, GROUP_CONCAT(keyword ORDER BY keyword DESC SEPARATOR ',') AS keywords FROM YOURPREFIX_categories cats, YOURPREFIX_keywords kws WHERE cats.id = kws.cat_id GROUP BY cats.id