Your question is a bit unclear, and you don’t say which version of MSSQL you have, but provided that you want to find the latest job result for each job, you can simply query the job tables directly:
select
j.name as 'Job', jh.run_status as 'Result of last run'
from
msdb.dbo.sysjobs j
join msdb.dbo.sysjobhistory jh
on j.job_id = jh.job_id
where
jh.step_id = 0 and
jh.run_date = (select max(run_date) from msdb.dbo.sysjobhistory where job_id = jh.job_id) and
jh.run_time = (select max(run_time) from msdb.dbo.sysjobhistory where job_id = jh.job_id and run_date = jh.run_date)
. sysjobhistory run_status. , , , (run_date, run_time) datetime. , TSQL , , Smo.