Question
Query String - Sort by 2 Keys
Hi,
I am using a MySQL database with php through DW8. I have a small problem ok. I have a football fixtures table with different age groups playing matches so I use the following query string to extract the resultset
"Select * from Fixtures sort by age ASC;"
This is fine ok, and it returns me all the e.g. age 10 matches for the next year. But can i add anything to the code to make it sort within the ages then by "fixture_id" ascending? e.g. something like this:
SELECT * from fixtures sort by age ASC AND fixture_id ASC;
I hope I am being clear enough, in other words, is there a way to sort by one key and then sort within those results by another key?
Stone
I am using a MySQL database with php through DW8. I have a small problem ok. I have a football fixtures table with different age groups playing matches so I use the following query string to extract the resultset
"Select * from Fixtures sort by age ASC;"
This is fine ok, and it returns me all the e.g. age 10 matches for the next year. But can i add anything to the code to make it sort within the ages then by "fixture_id" ascending? e.g. something like this:
SELECT * from fixtures sort by age ASC AND fixture_id ASC;
I hope I am being clear enough, in other words, is there a way to sort by one key and then sort within those results by another key?
Stone
