Fastest and/or simplest query to build nav from table with "parent" structure?
What would be the fastest and/or simplest query to build a pretty url with the following table structure
pages
id
parent
slug
in which every node has a slug for building the pretty url. So e.g.
/about/history/intro
would represent the link to the intro page, which is child of history, which is child of about (> is selected)
>about
>history
>intro
photos
people
contact
disclaimer
Can this be done in one query? Or should it just be recursive until there is no parent?