id | login |
1 | Николай |
2 | Дмитрий |
id | author_user_id | performer_user_id | task_message | status
1 | 1 | 2 | Задача 1 | 2
id | status
1 | Ожидает
id : 1
author_user_id : {login: Николай}
performer_user_id: {login: Дмитрий}
task_message: Задача 1
status: Ожидает
SELECT `t`.`id`, `au`.`login`, `pu`.`login`, `t`.`task_message`, `ts`.`status`
FROM `TASK` AS `t`
LEFT JOIN `USER` AS `au` ON `au`.`id` = `t`.`author_user_id`
LEFT JOIN `USER` AS `pu` ON `pu`.`id` = `t`.`performer_user_id`
LEFT JOIN `TASK_STATUS AS `ts` ON `ts`.`id` = `t`.`status`
WHERE ...