Delete a from EntryAttribute as a
where exists (Select distinct x.entryid from entryattribute as x
inner join attributestring as y on y.attributeid = x.attributeid
where x.entryid = a.entryid
and y.attributeid = '513367ff-de82-4f84-b982-8c4b854a08e1')---Reg S
and exists (select distinct z.entryid from entryattribute as z
inner join attributestring as za on za.attributeid = z.attributeid
where z.entryid = a.entryid
and za.attributeid = 'c74ce292-06db-420e-83a6-a32d84fefa28')---Rule 144A