select t1.fcontent,
       t1.tsubmiteditid,
       t1.tsubmiteditmodelid,
       t1.createby,
       t1.changeby,
       t1.createdate,
       t1.changedate,
       t1.fstatus,
       t1.submitdate,
       t1.submitby,
       t1.tenterprise_userid,
       t2.fusertype,
       t2.fphonenumber,
       t3.fagentname,
       t3.fprovince,
       t3.fcity,
       t3.fcounty
from DSBCRM..tsubmitedit t1
       inner join DSBCRM..tenterprise_users t2
                  on t1.siteid = t2.siteid and t1.tenterprise_userid = t2.tenterprise_userid
       left join DSBCRM..tagents t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
where t1.fstatus = 'Μα½»'
  and t1.siteid =$siteid$
  and t1.tsubmiteditmodelid=$tsubmiteditmodelid$ and $where$