select distinct l.#_configField# flexFieldConfig from tbl_TER_TerritoryLevels l with (nolock) inner join tbl_TER_Territories t with (nolock) on t.levelId = l.levelId and t.ownerId = l.ownerId and t.fsl_tablecode = l.fsl_tablecode inner join tbl_OPR_ClientOperators opr with (nolock) on opr.territoryId = t.territoryId and opr.fsltablecode = t.fsl_tablecode and opr.ownerId = t.ownerId where opr.ownerId = and opr.fsltablecode = and opr.operatorId = inner join tbl_OPR_ClientOperators opr with (nolock) on opr.territoryId = t.territoryId and opr.fsltablecode = t.fsl_tablecode and opr.ownerId = t.ownerId inner join tbl_Fspro_members m with (nolock) on m.ownerId = opr.ownerId and m.fsl_tablecode = opr.fsltablecode and m.orgId = opr.operatorId and m.orgType = 'OPR' where m.ownerId = and m.fsl_tablecode = and m.fspro_userId = where t.ownerId = and t.fsl_tablecode = and t.territoryId in ( )