I am looking for a query, where I can ask for data by groups. example:
table group
-uID-|-parentID-|-someData-
0 | 0 | foo
1 | 0 | bar
2 | 1 | foobar
3 | 2 | test
4 | 2 | demo
The parent ID is pointing to the uID from the parental group.
For example: when I want group 3 I will get back "test" only. When I request group 1, the results will be: bar, foobar, test and demo. So I have to get all the rows, where the parentID matches my uID I am searching for.
Here is an image of the architecture for better understanding:
If I am looking for group 1, will get it and all the sub groups 2, 3 and 4.
Thank you.