select count(name), name, address, city, state, zipcode, oprSegment, NCES_districtId from tbl_OPR_Operators where oprSegment = 2 and ( NCES_districtId is not null and NCES_districtId <> '' ) group by name, address, city, state, zipcode, oprSegment, NCES_districtId having count( name ) > 1 select opr_id, cu_ipeds_id, name from tbl_OPR_Operators where oprSegment = 2 and NCES_districtId = #qmd_operators.NCES_districtId# update tbl_OPR_Operators set dupes = 'Y' where opr_id =