Sort MYSQL Concatenated values

0

I need to order some concatenated values with GROUP_CONCAT but the first concatenated value is not what I want to sort. This would be the SQL code

SELECT objects.*, GROUP_CONCAT(mvalues.value SEPARATOR ', ') as value, 
GROUP_CONCAT(mdescriptor.name SEPARATOR ', ') as name  FROM objects JOIN 
metadata_values mvalues ON objects.idObject = mvalues.idObject JOIN 
metadata_descriptors mdescriptor ON mvalues.idDescriptor = 
mdescriptor.idDescriptor WHERE objectType = 'EMBED' AND mdescriptor.name 
IN ('Year Created', 'Thumbnail Patch') GROUP BY objects.idObject ORDER BY 
value ASC

If there is a simpler way to separate the Thumbnail and Year Created, it would be better.

    
asked by Arielperez 08.09.2018 в 15:48
source

0 answers