I am struggling with a sort problem.
I have a table that looks like this:
aspect_id (int) aspect_text (memo) root_id (int) which has as a foreign key a aspect_id
I have a non-cyclic tree with the following dummy data:
aspect_id aspect_text root_id 1 root null 2 aspect1 1 3 aspect2 1 4 aspect3 2 5 aspect5 4
In the example, the data is sorted correctly, but not in my database. I want to sort that it starts from the root element, then finds the child element, displays that child element and does it recursively.
With CTE, this is quite doable. Access does not support this. With CTE, this would be something like:
WITH aspectTree (aspect_id, root_id, Level
Jeroen
source share