Leetcode 1767. 寻找没有被执行的任务对

2021-12-21  本文已影响0人  七齐起器

https://leetcode-cn.com/problems/find-the-subtasks-that-did-not-execute/

1767.png
select a.task_id,convert(a.subtask_id,unsigned integer)subtask_id
from(
select a.task_id,b.subtask_id 
from Tasks a,(
    select @id:=@id+1 subtask_id  from (select @id:=0) as init,Executed
)b
where a.subtasks_count>=b.subtask_id
order by a.task_id,b.subtask_id 
)a left join Executed b on a.task_id=b.task_id and a.subtask_id=b.subtask_id
where b.task_id is null 

上一篇下一篇

猜你喜欢

热点阅读