I want to know if I can assemble a part.( Which is possible if I have all the raw material). So from the Table I want to select the item number only if Quantity for raw material is NOT NULL (not zero).
So I want the result AS
Model 2
Model 3
Model 4
The query I am using is
SELECT DISTINCT ItemNumber FROM TABLE WHERE QUANTITY IS NOT NULL
But because in 2 rows Model 1 have some quantity which is not NULL I am getting that in result as well.
Please let me know a way of fixing it.
Best Answer
you can use NOT IN and a subselect
db<>fiddle here