SELECT `a`.*, `b`.`position`
FROM `hr__leave_entitlement` `a`
JOIN `company__position` `b` ON `b`.`id` = `a`.`category_id`
WHERE `year` = '2019'
AND `type_id` = '5'
AND `a`.`is_delete` =0
ORDER BY `a`.`year` DESC, `a`.`category_id` ASC