select *  from Master where BRANCH+Code
in (select  BRANCH+Code from Master
group by  BRANCH+Code
having count( BRANCH+Code)>1)
order by  BRANCH+Code



delete from Master where RecordKey in
(select max(RecordKey)  from Master where  BRANCH+Code
in (select   BRANCH+Code from master
group by  BRANCH+Code
having count( BRANCH+Code)>1)
group by  BRANCH+Code
)



