Я пытаюсь получить некоторые данные из моей базы данных.
Это выглядит примерно так
ГРУППЫ
groups_id
, groups_name
, groups_description
, groups_active
, groups_hash
, groups_entry_date
, user_id
, groups_email
, groups_sms
CUSTOMERS_GROUPS
customers_hash
, groups_hash
CUSTOMERS
customers_id
, customers_first_name
,customers_surname
, customers_telephone
, customers_email
, customers_telephone_active
, customers_email_active
, client_type
, customers_hash
, customers_entry_date
Я хочу customer.groups_hash и groups.groups_name в форме concat,Вот моя попытка ...
SELECT * , GROUP_CONCAT( DISTINCT customers_groups.groups_hash
SEPARATOR '/' ) , GROUP_CONCAT( groups.groups_name
SEPARATOR '/' )
FROM customers
INNER JOIN customers_groups ON ( customers.customers_hash = customers_groups.customers_hash )
LEFT JOIN groups ON ( customers_groups.customers_hash = groups.groups_hash )
WHERE groups.groups_active ='1' GROUP BY customers.customers_entry_date
, но она возвращает мне нулевой набор ...