I want to do a query on items but also have groups listed and sorted by name. My tables are:
Code:
groups
---------
id
name
items
---------
id
name
group_id
and I have an sql statement like:
Code:
SELECT `items`.`id`,`items`.`name` FROM `items` LEFT JOIN `groups` ON `items`.`group_id`=`groups`.`id` ORDER BY `name`LIMIT 10,10
but that doesn't work. what I need is to have groups.name and items.name combined and sorted alphabetically.
I can think of one way to do it (dumping the results to a temporary table then sort in another select) but am wondering which is the better or if there is a another way.
__________________