in reply to Re^2: Sorting and Grouping with two different fields
in thread Sorting and Grouping with two different fields

I would just add another field SMALLINT from 1-50 called sort_order and then you can apply your arbitrary sort order to each state...
UPDATE table1 SET sort_order = 1 WHERE state = "Virginia"
Then you can
ORDER BY sort_order DESC, city DESC

Replies are listed 'Best First'.
Re^4: Sorting and Grouping with two different fields
by atemon (Chaplain) on Jul 12, 2007 at 14:52 UTC

    Your answer is too specific. If its dealing with only 50 states of US, Its OK to assign 1-50 called sort order. Here I am NOT allowed to alter the structure of the table as there are many other programs that depends on no of columns and other structure of the table. I am NOT allowed to add any temperory table. We wont mind the overhead caused by the sort algorith implemented. What I am looking for is a logic like Limbic~Region suggested.