Это то, как вы могли бы добиться этого, используя пивот
select
emp_id,
name,
[1] as first_ticket,
[2] as [2nd_ticket],
[3] as [3rd_ticket],
[4] as [4th_ticket],
[5] as [5th_ticket]
from (
select t1.emp_id,
t1.name,
t2.TICKET,
t2.RANK_OF_TICKET
from t1
left join t2 on t1.emp_id=t2.emp_id) p
PIVOT
(
MIN(TICKET) FOR RANK_OF_TICKET IN ([1],[2],[3],[4],[5])
) as pvt
ORDER BY emp_id