select distinct a.name,c.query,c.delete from name a ,query b ,delect c
where  c.funcid =a.id and  c.funcid<>a.id