imstillatwork
IS-IT--Management
There is no way to sort each group of results differently in a single query is there?
That probably does not make sense, here's what I'm doing:
select category.title,category.sortContentBy,content.title
from category
left join content
on content.category_id = category.id
category.sortContentBy is 1 or 0
0 being sort by content.date_added
1 being sort by content.sort_order
Is there any way to sort each left join dynamically on a per category basis? so all the content items matching the join are sorted by that categories specified sort-order?
It's a long shot, but what I HATE to have to do is output all the categories and run a query for each to get the content. The content in each category will need to be sorted in a specific way, which is saved in the category.sortContentBy field...
Kevin
Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
That probably does not make sense, here's what I'm doing:
select category.title,category.sortContentBy,content.title
from category
left join content
on content.category_id = category.id
category.sortContentBy is 1 or 0
0 being sort by content.date_added
1 being sort by content.sort_order
Is there any way to sort each left join dynamically on a per category basis? so all the content items matching the join are sorted by that categories specified sort-order?
It's a long shot, but what I HATE to have to do is output all the categories and run a query for each to get the content. The content in each category will need to be sorted in a specific way, which is saved in the category.sortContentBy field...
Kevin
Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!