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.
too easy? (Score:1)
This seems obvious?
ORDER BY id=5, id=7, id=1, id=48
rjbs
Re: (Score:2)
Is that SQL standard? The solution I've gone with is actually much simpler.
Re: (Score:1)
I have never seen a SQL where that didn't work. I am also interested to see what could be much simpler than that. :)
rjbs
Re: (Score:2)
OK, a few people on Twitter have struck out on this and Abigail guessed something similar to what you and Adrian guessed.
The solution is:
Turns out it's a deterministic emergent property of materialized paths. There is one caveat I realized, though. If you have multiple trees and you want to see the root nodes, you can do this:
However, some people omit the ID from the path. So you'd have this (in particular, note the path for the 5 node):
Re:too easy? (Score:1)
Reply to This
Parent
Re: (Score:2)
With the caveat above, yes, I think it might be.