Need some help on this SQL Query. Node is a table of products and each product has n images on table field_data_field_images. I need to select all of those image file names into one column separated by comma (as example "image1.jpg, image2.jpg" and so on). So first I need to get all of the image ID's from field_data_field_images and then get the file names itself from file_managed.
SELECT node.*,
file_managed.filename,
field_data_field_product_code.field_product_code_value,
FROM node
LEFT JOIN field_data_field_images ON node.nid = field_data_field_images.entity_id
LEFT JOIN file_managed ON field_data_field_images.field_images_fid = file_managed.fid
WHERE node.language = 'lt' AND node.type = 'products'
GROUP BY nid