Untitled

 avatar
unknown
mysql
2 years ago
348 B
7
Indexable
SELECT 
    s.*, GROUP_CONCAT(DISTINCT i.location, ';', i.bin) locations
FROM
    (SELECT 
        invoice, productcode, option1
    FROM
        shipment
    WHERE
        invoice = '201259494') s
        JOIN
    inventoryitem i ON s.productcode = i.product
        AND s.option1 = i.size
        group by i.product
        order by locations asc
Editor is loading...