There is a request:
SELECT GROUP_CONCAT(DISTINCT wh.uid ORDER BY wh.id) as property_uid, GROUP_CONCAT(DISTINCT wh.folder_name ORDER BY wh.id) as property, GROUP_CONCAT(DISTINCT pr.uid) FROM warehouse_folders wh RIGHT JOIN product_property pp ON wh.uid = pp.property_uid LEFT JOIN products pr ON pr.uid = pp.product_uid WHERE wh.parent_folder_uid IN (160819192400136, 160819192400134) GROUP BY pr.uid ORDER BY property ;
The result of which:
Problem: the property
field has the same name - "Green, May", but a different product ID
(right column). Because GROUP BY pr.uid
it throws them in different lines.
What I want as a result: remove the repetition (ie, -1 line), and the product id
, which has the same property
, put next.
How to do it?