select t1.tstoreid,t1.fstorenum,t1.fstorename,t1.faddress,t1.fphonenumber,t1.tagentsid,t2.fagentnum,t2.fagentname from tstore t1
inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
where t1.siteid=$siteid$ and $where$
