上传者: 43855793
|
上传时间: 2022-06-19 19:03:24
|
文件大小: 29KB
|
文件类型: PNG
1、SELECT
*
FROM
(
SELECT
d.id,
( SELECT count( 1 ) FROM t_tree dd WHERE dd.parent_uuid = d.id ) AS count
FROM
t_tree d
) a
WHERE
a.count =0;
2、SELECT
t3.id
FROM
t_tree t3
WHERE
t3.id NOT IN ( SELECT t1.id FROM t_tree t1, t_tree t2 WHERE t1.id = t2.parent_uuid )