Untitled
unknown
mysql
a month ago
995 B
3
Indexable
Never
SELECT ROUND(FORMAT(j2.cost, 'c')) cost, ROUND(FORMAT(p.retailprice, 'c')) retail, CONCAT('s', j2.serialnumber) serialnumber, j2.product, j2.size, j2.location, j1.source FROM (SELECT YEAR(updatedate) yr, MONTH(updatedate) mo, t1.productcode, t1.option1, serialnumber, source FROM inventoryupdate t1 JOIN inventoryupdate_extend t2 ON t1.id = t2.inventoryupdateid WHERE reasoncode = '54' AND source IN ('Manual Adjust by Ruben Esparza' , 'Manual Adjust by Jenny Yip') AND quantity > prevupdatequantity AND date(updatedate) >= '2023-09-01' AND date(updatedate) <= '2023-10-31' LIMIT 100000000) j1 LEFT JOIN inventoryitem j2 ON j1.serialnumber = j2.serialnumber AND location = 'Inventory Defect Pending' AND qtyonhand = 1 JOIN product p ON p.code = j2.product LIMIT 10000000000