GROUP CONCAT not working for some reason

Optiq picture Optiq · Dec 31, 2012 · Viewed 8.1k times · Source

I'm forming a select statement and am getting this error.

FUNCTION GROUP_CONCAT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

I don't understand this because group concats worked with the code someone gave me that I built my new code from. Here's how it looks

SELECT
`shirts`.`shirt_name`,
`shirts`.`men` AS `main_photo`,
GROUP_CONCAT (`shirt_sizes`.`size_name`) AS `sizes`
FROM
`shirts`
JOIN
`shirts_link` ON `shirts_link`.`shirt_id`=`shirts`.`id`
JOIN
`shirt_sizes` ON `shirt_sizes`.`id`=`shirts_link`.`size_id`
JOIN
`shirt_prices` ON `shirt_prices`.`id`=`shirts_link`.`price_id`
WHERE `men`!=''
GROUP BY
`shirt_prices`.`price_cat`

Can someone please help?

Answer

AndreKR picture AndreKR · Dec 31, 2012

There must be no space between function name and parenthesis. Change

GROUP_CONCAT (`shirt_sizes`.`size_name`) AS `sizes`

to

GROUP_CONCAT(`shirt_sizes`.`size_name`) AS `sizes`