Java代码
- SELECT
- b.*
- FROM
- tree AS a,
- tree AS b
- WHERE
- a.id= b.pid
- AND(a.id= ? OR a.pi= ?)
Java代码
- SELECT
- *
- FROM
- tree t
- WHERE
- NOT EXISTS(
- SELECT
- 1
- FROM
- tree t1,
- tree t2
- WHERE
- t1.id= t2.pid
- AND t1.id= t.id
- )
Java代码
- SELECT
- *
- FROM
- tree t
- WHERE
- NOT EXISTS(
- SELECT
- 1
- FROM
- tree t1,
- tree t2
- WHERE
- t1.id= t2.pid
- AND t1.id= t.pid
- )