Answer the question
In order to leave comments, you need to log in
How to execute queries with data output with comparison conditions inside a table in PostgreSQL?
Here is a table with the following content:
id | name | parent_id |
---|---|---|
one | Test 01 | 0 |
2 | Test 02 | 0 |
3 | Test 03 | 0 |
4 | Sub test 01 | one |
5 | Sub test 02 | one |
6 | Sub test 03 | one |
id | name | parent_id | parent |
---|---|---|---|
one | Test 01 | 0 | NULL |
2 | Test 02 | 0 | NULL |
3 | Test 03 | 0 | NULL |
4 | Sub test 01 | one | Test 01 |
5 | Sub test 02 | one | Test 01 |
6 | Sub test 03 | one | Test 01 |
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question