SELECT `a`.`id` as `customer_id`, `a`.`name`, `a`.`roc_no`, `a`.`email`, `b`.`name` as `master`, `d`.`type`, `e`.`grade`, `g`.`status`
FROM `customer` `a`
LEFT JOIN `customer` `b` ON `b`.`id` = `a`.`master_id`
LEFT JOIN `customer__type` `d` ON `d`.`id` = `a`.`type_id`
LEFT JOIN `customer__grade` `e` ON `e`.`id` = `a`.`grade_id`
LEFT JOIN `customer__status` `g` ON `g`.`id` = `a`.`status_id`
WHERE `a`.`is_delete` =0
ORDER BY `a`.`name` ASC