Hi!I have a sorting problem that I hope you can help me with. My task is to sort a table in two different ways, first all elements with a Code containing only two digits and the name in upper case (root nodes) should be sorted by Code, then all rows starting with the root-nodes number (sub-nodes) shold be sorted by Name.Given this short exempel of my tabel:Code Name------------ ---------------10 HUMANIORA10.0.0.0.100 Barnkultur10.0.0.0.400 Adamologi10.0.0.0.500 Forlagskunskap20 KONSTNARLIGA20.0.0.0.100 Takkunskap20.0.0.0.1000 Bild20.0.0.0.1100 Solistutbildning
My goal is to have it sorted in the following way:Code Name------------ ---------------10 HUMANIORA <- Sorted by code (10 before 20)10.0.0.0.400 Adamologi10.0.0.0.100 Barnkultur <- Sorted by name (Adamologi before Barnkultur)10.0.0.0.500 Forlagskunskap20 KONSTNARLIGA20.0.0.0.1000 Bild20.0.0.0.1100 Solistutbildning20.0.0.0.100 Takkunskap
I will be a happy man if this could be fixed in SQL so I don´t have to mess around with the data in my application code.Thanks!/Jonas