Id
t_children
):Idparent_idparent1 | ||
---|---|---|
2 | ||
parent4 | 7 | |
2 | 7 | |
2 | ||
名
t_parent.max_children_key
t_children.sort_key
-因为缺少Child 2
和1 | 1 | 父母1个孩子1 | |
---|---|---|---|
2 | 父母1个孩子2 | 3 | |
3 | 父母1个孩子3 | 4 | |
1 | 父母2个孩子1 | 5 | |
4 | 父母2个孩子4 | 6 | |
1 | 父母3个孩子1 | 7 | |
1 | 父母4个孩子1 | 8 | |
7 | 父母5个孩子7 | 9 | |
2 | 父母6个孩子2 | 10 | |
2 | 父母6个孩子2(重复) | 11 | |
3 | 父母7个孩子3 | 12 | |
4 | 父母7个孩子4 | ||
和 | ?从这两个数据集中的基础,查询应返回: | Parent 2 |
Child 3
Parent 4
-因为缺少Child 2
to。
Child 7
Parent 5
to。
Child 1
-因为尽管有2个孩子,但缺少了
Child 6
Parent 6
-因为尽管有2个孩子,但缺少Child 1
和Parent 7
。
Child 1
的孩子的计数,但它不包括Child 2
和having count(1)
。
Parent 6
th这个查询与最大值的最大值及其每个唯一值的数量进行比较。
DB<>小提琴