Hello.
I've got a problem getting a SELECT query to sort two columns in ascending order. Both the BroadCategory and SubCategory table columns need to sort in alphabetical order. In other words, the BroadCategory needs to sort Art, Automotive, etc.. The SubCategory needs to sort alphabetically within each BroadCategory.
For some reason, when I SELECT the rows from the db it always puts the id=1 in the tenth position.
// This is the way the BroadCategory and SubCategory is in the table.
id BroadCategory SubCategory
1 Art Books
2 Art Country Music
3 Art Magazines
4 Art Movies
5 Art Museums
6 Art Music
7 Art News
8 Art Performing Arts
9 Art Television
10 Art Web sites
11 Automotive Aftermarket
12 Automotive Classic Autos
// I've tried numerous different types of SELECT queries.
// None of them work.
SELECT BroadCategory, SubCategory FROM TheTable ORDER BY BroadCategory, SubCategory ASC
SELECT BroadCategory, SubCategory FROM TheTable ORDER BY BroadCategory ASC, SubCategory ASC
SELECT BroadCategory, SubCategory FROM TheTable ORDER BY SubCategory ASC, BroadCategory
SELECT BroadCategory, SubCategory FROM TheTable ORDER BY BroadCategory, SubCategory ASC
// It always sorts with the number one id in the tenth position like below.
id BroadCategory SubCategory
2 Art Country Music
3 Art Magazines
4 Art Movies
5 Art Museums
6 Art Music
7 Art News
8 Art Performing Arts
9 Art Television
10 Art Television
1 Art Books //This should be at the top.
11 Automotive Aftermarket
12 Automotive Classic Autos
//----
Can anybody tell me how to get the SELECT query to work straight?
Thanks.