set nocount on
declare @MyTable table (
id int identity(1,1),
numA int,
numB int
)
Insert into @MyTable values(1,2)
Insert into @MyTable values(1,3)
Insert into @MyTable values(2,2)
Select id from @mytable
Group by id, numA, numB
Having (numA = 1) And...