You have three arrays called COMPOSER(1..11), FIRST_NAME(1..11), and BIRTH_YEAR(1..11). In this example, you can see the original order and the final order after the Sorta
instruction, depending on the syntax:
Sorta 10 BIRTH_YEAR, COMPOSER, FIRST_NAME |
Original order | Sorting order |
---|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | HAENDEL | Georg | 1685 | 2 | BACH | Johann | 1685 | 3 | STRAUSS | Johann | 1804 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | SCHUBERT | Frantz | 1797 | 6 | WAGNER | Richard | 1813 | 7 | STRAUSS | Johann | 1825 | 8 | STRAUSS | Richard | 1864 | 9 | BERG | Alban | 1885 | 10 | MOZART | Wolfgang | 1756 | 11 | | | 0 |
|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | BACH | Johann | 1685 | 2 | HAENDEL | Georg | 1685 | 3 | MOZART | Wolfgang | 1756 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | SCHUBERT | Frantz | 1797 | 6 | STRAUSS | Johann | 1804 | 7 | WAGNER | Richard | 1813 | 8 | STRAUSS | Johann | 1825 | 9 | STRAUSS | Richard | 1864 | 10 | BERG | Alban | 1885 | 11 | | | 0 |
|
Sorta BIRTH_YEAR, COMPOSER, FIRST_NAME |
Original order | Sorting order |
---|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | HAENDEL | Georg | 1685 | 2 | BACH | Johann | 1685 | 3 | STRAUSS | Johann | 1804 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | SCHUBERT | Frantz | 1797 | 6 | WAGNER | Richard | 1813 | 7 | STRAUSS | Johann | 1825 | 8 | STRAUSS | Richard | 1864 | 9 | BERG | Alban | 1885 | 10 | MOZART | Wolfgang | 1756 | 11 | | | 0 |
|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | | | 0 | 2 | BACH | Johann | 1685 | 3 | HAENDEL | Georg | 1685 | 4 | MOZART | Wolfgang | 1756 | 5 | BEETHOVEN | Ludwig | 1770 | 6 | SCHUBERT | Frantz | 1797 | 7 | STRAUSS | Johann | 1804 | 8 | WAGNER | Richard | 1813 | 9 | STRAUSS | Johann | 1825 | 10 | STRAUSS | Richard | 1864 | 11 | BERG | Alban | 1885 |
|
Sorta 10 COMPOSER,FIRST_NAME,BIRTH_YEAR Order By COMPOSER(indice+1), -BIRTH_YEAR(indice+1), FIRST_NAME(indice+1) |
Original order | Sorting order |
---|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | HAENDEL | Georg | 1685 | 2 | BACH | Johann | 1685 | 3 | STRAUSS | Johann | 1804 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | SCHUBERT | Frantz | 1797 | 6 | WAGNER | Richard | 1813 | 7 | STRAUSS | Johann | 1825 | 8 | STRAUSS | Richard | 1864 | 9 | BERG | Alban | 1885 | 10 | MOZART | Wolfgang | 1756 | 11 | | | 0 |
|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | BACH | Johann | 1685 | 2 | BEETHOVEN | Ludwig | 1770 | 3 | BERG | Alban | 1885 | 4 | HAENDEL | Georg | 1685 | 5 | MOZART | Wolfgang | 1756 | 6 | SCHUBERT | Frantz | 1797 | 7 | STRAUSS | Richard | 1864 | 8 | STRAUSS | Johann | 1825 | 9 | STRAUSS | Johann | 1804 | 10 | WAGNER | Richard | 1813 | 11 | | | 0 |
|
Sorta 10 COMPOSER,FIRST_NAME,BIRTH_YEAR Order By FIRST_NAME(indice+1),NAME(indice+1),-BIRTH_YEAR(indice+1) Desc |
Original order | Sorting order |
---|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | HAENDEL | Georg | 1685 | 2 | BACH | Johann | 1685 | 3 | STRAUSS | Johann | 1804 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | SCHUBERT | Frantz | 1797 | 6 | WAGNER | Richard | 1813 | 7 | STRAUSS | Johann | 1825 | 8 | STRAUSS | Richard | 1864 | 9 | BERG | Alban | 1885 | 10 | MOZART | Wolfgang | 1756 | 11 | | | 0 |
|
# | COMPOSER | FIRST_NAME | BIRTH_YEAR |
---|
1 | MOZART | Wolfgang | 1756 | 2 | WAGNER | Richard | 1813 | 3 | STRAUSS | Richard | 1864 | 4 | BEETHOVEN | Ludwig | 1770 | 5 | BACH | Johann | 1685 | 6 | STRAUSS | Johann | 1804 | 7 | STRAUSS | Johann | 1825 | 8 | HAENDEL | Georg | 1685 | 9 | SCHUBERT | Frantz | 1797 | 10 | BERG | Alban | 1885 | 11 | | | 0 |
|
The reason is that the array was sorted in the order of the following expressions: