Untitled

mail@pastecode.io avatar
unknown
mysql
16 days ago
735 B
2
Indexable
Never
SELECT 
    concat('s', serialnumber) serial,
    product,
    size,
    bin,
    location,
    previousbin,
    previouslocation,
    lastscandate,
    username
FROM
    shard.inventoryitemupdate
WHERE
    location = 'gifting returns'
        AND location <> previouslocation
        AND lastscandate >= '2024-01-01 00:00:00'
        AND lastscandate <= '2024-01-31 23:59:59';
        
        SELECT 
    COUNT(serialnumber) serials,
    location,
    lastscandate,
    username
FROM
    shard.inventoryitemupdate
WHERE
    location = 'gifting returns'
        AND location <> previouslocation
        AND lastscandate >= '2024-01-01 00:00:00'
        AND lastscandate <= '2024-01-31 23:59:59'
GROUP BY username
ORDER BY serials DESC
Leave a Comment