这是表结构:
表格任务
id(PK) name
1 Task 1
2 Task 2
表用户
id(PK) name
1 John Smith
2 Jack Will
表格任务
id(PK) taskId userId
1 1 1
2 1 2
3 2 1
表任务和用户使用表任务程序
具有一对多的关系答案 0 :(得分:2)
select
T1.taskId,T1.userId,
T2.name as User_name,
T3.name as Task_name
from Tasker T1
left join User T2 on T1.userId = T2.ID
left join Task T3 on T1.taskId = T3.ID