declare @T table
(
unitCode varchar(10),
stunum int,
assNo int,
subStatus varchar(3)
)
insert into @T values
('SIT111', 1000, 1, 'Yes'),
('SIT111', 1000, 2, 'No'),
('SIT111', 3000, 1, 'No')
select *
from @T as T
where T.subStatus = 'No' and
T.stunum not in (select stunum
from @T
where subStatus = 'Yes')