SELECT x.task_id, x.subtask_idFROM(select t1.task_id,t2.subtask_id from (select*from leetcode.ex_1767_tasks ) t1join(select1as subtask_id unionselect2as subtask_id unionselect3as subtask_id unionselect4as subtask_id ) t2 ON t1.subtasks_count >= t2.subtask_id) x left join (select task_id, ubtask_id from leetcode.ex_1767_executed ) y ON x.task_id= y.task_id and x.subtask_id=y.subtask_idWHERE y.subtask_id isNULLORDER BY x.task_id,x.subtask_id;