![]() | Closure table, tree rendering with GUID instead of auto-increment |
|
27 Feb 2013, 14:56
Niklas Bivald (4 posts) |
Hi, I’ve implemented a closure table system, for a group list (table: company_groups with columns id and name). The references are then stored in a closure table, company_groups_treepaths:
And then I am trying to get a tree structure out of it. The problem is that most of the solutions I find is using group_concat on the group id, assuming it’s an INT and auto_increment. However, I use GUID which makes it harder. I’ve looked through the other examples here and on stack overflow, but can’t really get a hang of it. For example, this query retrieved the right groups, but the wrong tree:
The correct order for that query should be (fetching all children of Swedbank):
Anyone got any good ideas? |
|
01 Mar 2013, 10:12
Niklas Bivald (4 posts) |
And the correct link is: here href=”http://sqlfiddle.com/# |
|
12 Mar 2013, 02:37
Niklas Bivald (4 posts) |
bit.ly/YFKgjr |
|
04 Mar 2013, 09:01
Niklas Bivald (4 posts) |
I reverted to the basics, http://karwin.blogspot.se/2010/03/rendering-tre… I ended up with |
| You must be logged in to comment |

