select top (1) t1.fobsurl
from tattachment t1
where t1.ownertable = 'tenterprise_users'
  and t1.ftype = 'headportrait'
  and t1.siteid =$siteid$
  and t1.ownerid=$tenterprise_userid$
order by t1.createdate desc