Answer the question
In order to leave comments, you need to log in
How to properly concatenate strings in SQL?
There is a query in the database of the form
SELECT
users.name AS users_name,
users.uid AS uid,
users.created AS users_created,
domain_editor.domain_id AS domain_editor_domain_id,
'user' AS field_data_field_user_statut_user_entity_type
FROM
users
LEFT JOIN domain_editor ON users.uid = domain_editor.uid
WHERE (( (users.status <> '0') ))
ORDER BY users_created DESC
LIMIT 10 OFFSET 0
GROUP_CONCAT(DISTINCT domain_editor.domain_id ORDER BY domain_editor.domain_id ASC SEPARATOR ',')
Answer the question
In order to leave comments, you need to log in
In group by list all fields except domain_id.
select
users.name AS users_name,
users.uid AS uid,
users.created AS users_created,
GROUP_CONCAT(DISTINCT domain_editor.domain_id ORDER BY domain_editor.domain_id ASC SEPARATOR ',') AS domain_editor_domain_id_concated,
'user' AS field_data_field_user_statut_user_entity_type
...
group by users_name, uid, users_created, field_data_field_user_statut_user_entity_type
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question