| Col1 | Col2 | Col3 | Col4 | Col5
--------------------------------------------------
| B1 | A1 | somedata | data | somedata
| B2 | A1 | somedata | data | somedata
| B3 | A1 | null | data | somedata
| C1 | B1 | null | data | somedata
| C2 | B1 | 1 | data | somedata
| D1 | C1 | 1 | data | somedata
| D2 | C1 | 4 | data | somedata
| D3 | C1 | 4 | data | somedata
| Z1 | K1 | A | B | C
| Z1 | K2 | A | B | C
A1
/ \ \
B1 B2 B3
/ \
C1 C2
/ \ \
D1 D2 D3
I have the following table structure. Col1 holds children of Col2. Other columns have other related data. The table holds data for a tree like structure. Is it possible to create a query that'll provide all the children for A1. In this case it'll be
B1
B2
B3
C1
C2
D1
D2
D3
I'm only familiar with simple joins and can't figure out how to query the data. Any help would be appreciated.