or
select * from bh1 where UserType='0'
union
select A.* from bh1 a
left join (select * from bh1 where UserType='0' ) b on a.UserName =b.UserName
where a.UserType='1' AND B.UserName IS NULL
select * from tt where UserType='0'
union
select * from tt a where UserType='1' and not exists(select UserName from tt
where UserType='0' and a.UserName =UserName )