add remove language chart show hidden hide
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE EXTENSION
DROP TABLE
CREATE TABLE
INSERT 0 8
tree level parent side
1 1 null
1.L2 2 1 L
1.R2 2 1 R
1.L2.L3 3 1.L2 L
1.L2.R3 3 1.L2 R
1.L2.L3.L4 4 1.L2.L3 L
1.L2.R3.R4 4 1.L2.R3 R
1.L2.R3.L4 4 1.L2.R3 L
SELECT 8
id tree person_id
1 1 1
2 1.L2 2
4 1.L2.L3 4
6 1.L2.L3.L4 6
SELECT 4
id tree person_id
1 1 1
2 1.L2 2
4 1.L2.L3 4
6 1.L2.L3.L4 6
SELECT 4