Untitled

mail@pastecode.io avatar
unknown
mysql
2 years ago
823 B
10
Indexable
Never
SELECT 
    CONCAT('s', serialnumber) AS Serial,
    product,
    bin,
    location,
    SUBSTRING_INDEX(locationhistory, ']', 1) AS Notes,
    lastscandate
FROM
    inventoryitem
WHERE
    product IN ('AIKA-WU168' , 'PTHO-WU96',
        'OSER-WU45',
        'KOSA-WU81',
        'RPCO-WU132',
        'DRBR-WU106',
        'KOPR-WU97',
        'ABEV-WU282',
        'CTIL-WU235',
        'ORIB-WU235',
        'SRIL-WU59',
        'BCOS-WU501',
        'TUXR-WU38',
        'SUMR-WU38',
        'OLAP-WU18',
        'ILIR-WU240',
        'SOOR-WU120',
        'EJAY-WA53',
        'VERB-WU48',
        'BSME-WA45',
        'ABAD-WU7',
        'LASR-WU43',
        'LORO-WU2',
        '111R-WU42')
        AND qtyonhand = 1
        AND location = 'Gift Pack Pending'
GROUP BY serial
ORDER BY lastscandate ASC
LIMIT 10000000