Delete A from GIS_Mall_Info A
inner join ( select MAX(id) as ID,Ref_ID from GIS_Mall_Info group by Ref_ID having count(1)>1 )
B on B.Ref_ID=A.Ref_ID and B.ID<>A.ID
Delete A from GIS_Mall_Info A
inner join ( select MAX(id) as ID,Ref_ID from GIS_Mall_Info group by Ref_ID having count(1)>1 )
B on B.Ref_ID=A.Ref_ID and B.ID<>A.ID