select t1.tagents_workersubmitid,
       t2.tenterprise_userid,
       t2.fname as fworkername,
       t2.frole,
       t1.fname,
       t1.fphonenumber,
       t1.fcommunity,
       t1.fhouseunit,
       t1.fhousenumber,
       t1.createdate,
       t1.fnotes
from tagents_workersubmit t1
         inner join tagents_workers t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid and
                                          t1.tenterprise_userid = t2.tenterprise_userid
where t1.siteid = $siteid$ and t1.tagentsid = $tagentsid$ and $where$ and t1.fismodify=0