NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
self-join (Score:1)
One option would be to build SQL for a self-join at run-time.
So /alpha/beta/ would produce a query:
select f2.idfrom foo f1, foo f2
where f1.parent = 0 and f1.name = 'alpha'
and f2.parent = f1.id and f2.name = beta'
This won't work if the path can have extra information after the structure. eg. /alpha/beta/productid/add
If the tree can be deeply nested, I'd go for a different data structure.
Reply to This
Re: (Score:1)