Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GROUP CONCAT not working for some reason

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?

like image 226
Optiq Avatar asked Dec 31 '12 00:12

Optiq


1 Answers

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`
like image 176
AndreKR Avatar answered Sep 29 '22 02:09

AndreKR