Hi ! I'd like to know how, with MySQL, we can first order datas by a certain variable, and after, for each row which have a variable in common, order them by another variable. I know this isn't clear, sorry. Let's see an example :
id | sct | date
1 | 1 | 4
2 | 1 | 2
3 | 2 | 1
4 | 1 | 6
5 | 2 | 5
6 | 2 | 3
First, sort by sct (ASC) :
(id;sct;date)
1;1;4
2;1;2
4;1;6
3;2;1
5;2;5
6;2;3
After, sorting by date (ASC), but keeping the the variables which have "1" as sct first, and after variables which have "2" as sct :
(id;sct;date);
2;1;2
1;1;4
4;1;6
3;2;1
6;2;3
5;2;5
How do I do that ?