loan returns

Anonymous
mysql
09/20/2024 5:39 PM
632 B
24
Indexable
SELECT 
    l.headerid, l.status, l.notes, i.*
FROM
    (SELECT 
        CONCAT('s', serialnumber) serial,
            product,
            size,
            bin,
            location,
            previouslocation,
            lastscandate
    FROM
        inventoryitem
    WHERE
        location = 'returns'
            AND previouslocation = 'loaned'
            AND qtyonhand = 1
    ORDER BY lastscandate ASC) i
        JOIN
    loanitem l ON l.serialnumber = i.serial
Editor is loading...
Leave a Comment