Как выбрать все элементы, которые начинаются с i
вместо Items.ItemCode = '107669'
SELECT p.ProjectNr AS Production,
gbkmut.oms25 AS Description,
(CASE
WHEN SUM(gbkmut.aantal) < 0 AND gbkmut.transsubtype <> 'J'
THEN -SUM(gbkmut.aantal)
ELSE SUM(gbkmut.aantal)
END) AS Quantity,
gbkmut.warehouse AS Warehouse,
gbkmut.id AS RecordNum
FROM PrProject p
JOIN gbkmut ON p.ProjectNr=gbkmut.project
AND gbkmut.bud_vers='MRP' AND gbkmut.transtype='B'
AND gbkmut.freefield1='P'
AND gbkmut.transsubtype IN ('A','B','J')
JOIN Items ON Items.ItemCode=gbkmut.artcode
AND Items.GLAccountDistribution=gbkmut.reknr
WHERE p.Type='P'
AND Items.ItemCode = '107669'
AND gbkmut.afldat >= {d '2019-01-01'}
AND gbkmut.afldat <= {d '2019-12-31'}
GROUP BY p.ProjectNr, gbkmut.oms25, gbkmut.warehouse, gbkmut.afldat, gbkmut.transsubtype, gbkmut.id
ORDER BY p.ProjectNR