1

i'm getting an error here when i try this sql ...

SELECT customers.customers_first_name GROUP_CONCAT(customers_groups.customers_hash SEPARATOR '') 
FROM customers INNER JOIN customers_groups ON (customers.hash = customers_groups.customers_hash) 
GROUP BY customers.customers_entry_date



CUSTOMERS DATABASE
`customers_id`, 
`customers_first_name`, 
`customers_surname`, 
`customers_telephone`, 
`customers_email`, 
`customers_telephone_active`, 
`customers_email_active`, 
`client_type`, 
`customers_hash`, 
`customers_entry_date`

CUSTOMERS_GROUPS
`groups_hash`
`customers_hash
2
  • 1
    SELECT customers.customers_first_name GROUP_CONCAT(customers_groups.customers_hash SEPARATOR '')is missing a comma to separate the columns.. Should be SELECT customers.customers_first_name, GROUP_CONCAT(customers_groups.customers_hash SEPARATOR '')... i vote close this question because it looks like to be a simple typographical error. Commented Jun 12, 2018 at 15:25
  • 1
    Please, post the error message when asking this kind of question Commented Jun 12, 2018 at 15:30

1 Answer 1

1

Ideally, you should post the error message with the question but check below solution.

SELECT customers.customers_first_name, GROUP_CONCAT(customers_groups.customers_hash SEPARATOR '') 
FROM customers INNER JOIN customers_groups ON (customers.hash = customers_groups.customers_hash) 
GROUP BY customers.customers_entry_date

SELECT customers.customers_first_name ,

"," was missing in the select statement before GROUP_CONCAT

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.