回答編集履歴
1
条件もれ修正
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
id, 親id, 階層
|
8
8
|
|
9
|
-
, exists(SELEC 1 from myTable where 親ID=t1.ID) as 子あり
|
9
|
+
, exists(SELEC 1 from myTable where 親ID=t1.ID and 階層=t1.階層+1) as 子あり
|
10
10
|
|
11
11
|
FROM
|
12
12
|
|