I have a data structure that looks something like this:
main(main_id, name)
container(container_id), order, name)
item(item_id, name)
item_order(item_order_id, order, item_id)
- There is a many to one relationship between container and main
- There is a many to one relationship between item_order and container
- There is a one to one relationship between item_order and item (the same item can show up in multiple containers, which is why the ordering information is stored in a separate table rather than the same one like container)
What I want to do for a specific main is select all the containers in ascending order, along with all the items (through their order objects) in ascending order.
I have tried The Example I Found Here, and it works great for sorting the containers, what I cannot figure out is how to expand this to sorting the items within the containers.
Does anyone have any idea how to accomplish this?