我想将此问题转换为查询。估计应该是三个leftjoin和两个select
exercises
+-----+---------+
| id | require |
+-----+---------+
| 1 | |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | |
| 6 | 5 |
| 7 | |
+-----+---------+
done
+-----+
| id |
+-----+
| 1 |
| 2 |
+-----+
做完功法一和二,我现在可以做哪些功法?
解:3,5,7
我的逻辑流程,一步一步:(
全部)-SELECT(必需-完成)-(完成)
(1,2,3,4,5,6,7)-SELECT((1,2,3,5)- (1,2)) - (1,2)
(1,2,3,4,5,6,7) - SELECT(3,5) - (1,2)
(1,2,3,4,5 ,6,7) -(4,6) - (1,2)
(3,5,7)
如何编写查询?