23

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Optiq
  • 2,835
  • 4
  • 33
  • 68
  • 2
    What database are you using? The syntax looks like MySQL, which supports `group_concat`. – Gordon Linoff Dec 31 '12 at 00:28
  • I know, that's the odd thing because like I said, it worked with the other one I crafted this from, but the MySQL version is 5.1.66. – Optiq Dec 31 '12 at 00:30

1 Answers1

60

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`
AndreKR
  • 32,613
  • 18
  • 106
  • 168