select cho.cho_name, opr.ownerId, opr.fsltablecode, opr.fsl_choId, dd.cdr_recordId, cdr.cdr_dstName, count(*) as deliveryLocations from tbl_OPR_ClientOperators opr with (nolock) inner join tbl_OPR_DistributionDetails dd with (nolock) on dd.ownerId = opr.ownerId and dd.ownerType = opr.fsltablecode and dd.operatorId = opr.operatorId inner join tbl_CHO_Operators cho with (nolock) on cho.cho_id = opr.fsl_choId inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId = dd.cdr_recordId and cdr.ownerId = dd.ownerId and cdr.fsl_tablecode = dd.ownerType where opr.fsl_choId > 0 and nullif( dd.accountNumber, '' ) is not null and opr.fsltablecode <> 'BRO' and opr.ownerId= and opr.fsltablecode = group by opr.ownerId, opr.fsltablecode, opr.fsl_choId, dd.cdr_recordId, cdr.cdr_dstName, cho.cho_name having count(*) > 1 order by opr.fsltablecode, opr.ownerId
1FS Operator Client Distributor Delivery Locations
#htmleditformat( cho_name )# (#fsl_choId#) #fsltablecode##ownerId# #htmleditformat( cdr_dstName )# #lsnumberformat( deliveryLocations )#