select ROW_NUMBER()over(order by t1.ftotalscore desc) as row,
       t1.fname,
       t1.ftotalscore,
       t2.fname as fsaler
from tagents_workers t1
         left join tenterprise_users t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid and t1.createuserid=t2.tenterprise_userid
where t1.siteid =$siteid$ and t1.tagentsid=$tagentsid$ and fiscooperation=1 and $where$