Untitled

mail@pastecode.io avatar
unknown
mysql
7 months ago
532 B
2
Indexable
Never
SELECT 
    COUNT(i.serialnumber) qty,
    i.size,
    i.product,
    p.name,
    p.wholesalecost AS priceperunit,
    FORMAT(SUM(p.wholesalecost), 'c') RoundedCost
FROM
    (SELECT 
        serialnumber, product, size
    FROM
        inventoryitem
    WHERE
        (location LIKE 'APOPStore-RackMoore%'
            OR location LIKE 'APOPStore-FRONTPalletMoore%'
            OR location LIKE 'APOPStore-BACKPalletMoor%')
            AND qtyonhand = 1) i
        JOIN
    product p ON p.code = i.product
GROUP BY i.product , i.size
Leave a Comment