Вы даже можете попробовать это
declare @t table(object int, keys varchar(10), value varchar(10))
insert into @t
select 1,'a','A' union all select 1,'b','B' union all
select 1,'c','C' union all
select 2,'a','F' union all select 2,'b','B' union all
select 3,'a','A' union all select 3,'b','B' union all
select 3,'d','D'
--select * from @t
Запрос
select object from @t
where keys = 'a' and value ='A'
or keys = 'b' and value ='B'
group by object
having COUNT(object)>1
Выход:
object
1
3