select b.industry, b.loginname,a.enddate,a.verify, a.userid,a.position,b.companyname
from c_job as a left join u_userinfo as b on a.UserID=b.UserID
where a.id in (select max(id) from c_job group by UserID)
and a.userid in (SELECT DISTINCT b.UserID FROM dbo.U_UserInfo
INNER JOIN dbo.C_Job ON b.UserID = a.UserID)
from c_job as a left join u_userinfo as b on a.UserID=b.UserID
where a.id in (select max(id) from c_job group by UserID)
and a.userid in (SELECT DISTINCT b.UserID FROM dbo.U_UserInfo
INNER JOIN dbo.C_Job ON b.UserID = a.UserID)