Untitled

mail@pastecode.io avatar
unknown
mysql
7 months ago
1.0 kB
5
Indexable
Never
SELECT 
    DATE(lastupdated) date, COUNT(serialnumber) MovedToTransit
FROM
    shard.inventoryitemupdate
WHERE
    lastupdated >= '2023-11-18'
        AND lastupdated < '2023-11-24'
        AND location = 'UK Rebalance in-transit'
        AND previouslocation LIKE '8-%'
GROUP BY DATE(lastupdated)
LIMIT 100000;

SELECT 
    DATE(lastupdated) date, COUNT(serialnumber) units
FROM
    shard.inventoryitemupdate
WHERE
    DATE(lastupdated) >= '2023-11-18'
        AND DATE(lastupdated) <= '2023-11-24'
        AND location LIKE '8-%'
        AND previouslocation = 'intl-return-uk'
        AND location <> previouslocation
GROUP BY DATE(lastupdated)
LIMIT 100000;

SELECT 
    DATE(boxtime) date,
    COUNT(shipmentid) units,
    CONCAT('$',
            FORMAT(ROUND(SUM(saleprice)), 'c', 'c')) SalePriceSum
FROM
    shipment
WHERE
    date(boxtime) >= '2023-11-18'
        AND date(boxtime) <= '2023-11-24'
        AND (itemlocation LIKE '8-%'
        OR itemlocation = '8')
GROUP BY DATE(boxtime)
LIMIT 100000;
Leave a Comment