By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 4 Duplicates: 0 Warnings: 0
id | parent_id |
---|---|
1 | null |
2 | 1 |
3 | 2 |
1 | 3 |
id | parent_id | lvl |
---|---|---|
1 | null | 0 |
2 | 1 | 1 |
3 | 2 | 2 |
1 | 3 | 3 |
Records: 4 Duplicates: 0 Warnings: 0
id | parent_id |
---|---|
1 | null |
2 | 1 |
3 | 2 |
1 | 3 |
id | parent_id | lvl |
---|---|---|
1 | null | 0 |
2 | 1 | 1 |
3 | 2 | 2 |
1 | 3 | 3 |