I agree with Akina - subtype doesn't seem to have any logic behind which value is selected, if you exclude subtype and use type and number you can write your query as follows using the criteria that all rows returned by the correlated subquery have number equal to 0, where the correlation is by item. see below
create table #table1 (item varchar(10), subitem varchar(10), number int)
insert #table1 values('Shirt','XL', 3),('Shirt','L', 0),('Shirt','M', 0),('Phone','64Gb',0) ,('Phone','32Gb',0),
('Shirt','S', 0), ('Pant','XL', 0),('Pant','L', 0),('Pant','M', 0), ('Pant','S', 0)
select * from #table1
SELECT distinct
t1.Item,
t1.Number
FROM #Table1 t1
WHERE 0 = ALL
(
SELECT t2.Number
FROM #Table1 t2
WHERE t1.Item = t2.Item
)
subitem
? Why'XL'
is returned and all another are skipped?