select operatorId, companyName, mfrcustnum
from tbl_OPR_ClientOperators opr
inner join tbl_TER_Territories ter
on ter.territoryId = opr.territoryId
where opr.ownerId = 1 and opr.fsltablecode = 'MFR'
and opr.mfrcustnum = '0'
order by companyName
select operatorId, companyName, mfrcustnum
from tbl_OPR_ClientOperators opr
inner join tbl_TER_Territories ter
on ter.territoryId = opr.territoryId
where opr.mfrcustnum <> '0' and opr.mfrcustnum <> ''
and opr.operatorId =
#companyName#
#mfrcustnum#
NULL#qmd_lookup.mfrcustnum#
update tbl_OPR_ClientOperators
set mfrcustnum =
where operatorId =
and mfrcustnum =