| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) | |
|
geek
|
SQL sorting
I want to do a query on items but also have groups listed and sorted by name. My tables are: Code:
Code:
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. Quote:
|
|
|
|
|
|
|
#3 (permalink) | |
|
geek
|
I don't think GROUP BY is an option. An Item may not be part of a group leaving its group field as 0. The GROUP BY option would combine all these items would it not? Quote:
|
|
|
|
|
#4 (permalink) |
|
Registered
Join Date: Sep 2006
Location: Adelaide, Australia
Posts: 12
|
I'm not too sure what you actually want from your SQL. What do you mean by "what I need is to have groups.name and items.name combined and sorted alphabetically"? Can you give us an example of what you want. If your trying to sort multiple columns you can try: Code:
|
|
![]() |