1767 寻找没有被执行的任务对
SQL架构
Create table If Not Exists Tasks_1767 (task_id int, subtasks_count int);
Create table If Not Exists Executed_1767 (task_id int, subtask_id int);
Truncate table Tasks_1767;
insert into Tasks_1767 (task_id, subtasks_count) values ('1', '3');
insert into Tasks_1767 (task_id, subtasks_count) values ('2', '2');
insert into Tasks_1767 (task_id, subtasks_count) values ('3', '4');
Truncate table Executed_1767;
insert into Executed_1767 (task_id, subtask_id) values ('1', '2');
insert into Executed_1767 (task_id, subtask_id) values ('3', '1');
insert into Executed_1767 (task_id, subtask_id) values ('3', '2');
insert into Executed_1767 (task_id, subtask_id) values ('3', '3');
insert into Executed_1767 (task_id, subtask_id) values ('3', '4');
表:Tasks
+----