假设我有下表
Person table
和personStatus table
.
declare @Persons table
(PersonId int)
insert into @Persons select 10
insert into @Persons select 11
declare @PersonStatus table
(id int,statuss int)
insert into @PersonStatus (id,statuss) values(10,0)
insert into @PersonStatus (id,statuss) values(10,0)
insert into @PersonStatus (id,statuss) values(11,1)
insert into @PersonStatus (id,statuss) values(10,0)
insert into @PersonStatus (id,statuss) values(11,0)
现在我想找到所有状态都为零的人员 ID 结果只是 ---> 10
怎么做?