select principalTerritoryId, operatorId, coalesce( mfrCustNbr, '' ) mfrCustNbr, min( principalOperatorId ) minPrincipalOperatorId, count(*) dupCount from tbL_BRO_PrincipalOperators group by principalTerritoryId, operatorId, coalesce( mfrCustNbr, '' ) having count(*) > 1 delete from tbl_BRO_principalOperators where principalTerritoryId = and operatorId = and coalesce( mfrCustNbr, '' ) = and principalOperatorId >
Principal Operator Cleanup
principalTerritoryId operatorId mfrCustNbr dupCount deleted
#principalTerritoryId# #operatorId# #mfrCustNbr# #dupCount# #_r.recordCount#
select principalTerritoryId, operatorId, coalesce( mfrCustNbr, '' ) mfrCustNbr, min( principalOperatorId ) minPrincipalOperatorId, count(*) dupCount from tbL_BRO_PrincipalOperators group by principalTerritoryId, operatorId, coalesce( mfrCustNbr, '' ) having count(*) > 1
select principalTerritoryId, cdrRecordId, coalesce( mfrCustNbr, '' ) mfrCustNbr, min( principalDistributorId ) minPrincipalDistributorId, count(*) dupCount from tbL_BRO_PrincipalDistributors group by principalTerritoryId, cdrRecordId, coalesce( mfrCustNbr, '' ) having count(*) > 1 delete from tbl_BRO_principalDistributors where principalTerritoryId = and cdrRecordId = and coalesce( mfrCustNbr, '' ) = and principalDistributorId >
Principal Distributor Cleanup
principalTerritoryId cdrRecordId mfrCustNbr dupCount deleted
#principalTerritoryId# #cdrRecordId# #mfrCustNbr# #dupCount# #_r.recordCount#
select principalTerritoryId, cdrRecordId, coalesce( mfrCustNbr, '' ) mfrCustNbr, min( principalDistributorId ) minPrincipalDistributorId, count(*) dupCount from tbL_BRO_PrincipalDistributors group by principalTerritoryId, cdrRecordId, coalesce( mfrCustNbr, '' ) having count(*) > 1