Untitled

mail@pastecode.io avatar
unknown
mysql
a year ago
348 B
3
Indexable
Never
SELECT 
    s.*, GROUP_CONCAT(DISTINCT i.location, ';', i.bin) locations
FROM
    (SELECT 
        invoice, productcode, option1
    FROM
        shipment
    WHERE
        invoice = '201266556') s
        JOIN
    inventoryitem i ON s.productcode = i.product
        AND s.option1 = i.size
        group by i.product
        order by locations asc