sure:select ID  ,name from  A
where (ID ,name)
 in (
       select ID ,name from  A
       where code='0800'
)