Oracle implements find_in_set sorting for mysql!
Oracle implements sorting similar to MYSQL find_in_set, function decode:
Select * from tb_info_game where gameid in (, 18) order by decode (gameid)
By default7 # zbphp.com
Reference CDSN post: http://topic.csdn.net/t/20060124/08/4532718.html
Question:
Bytes ------------------------------------------------------------------------------------
SQL statement
Order by can be sorted by specified order No
For example, the value of a field in the record nch hch acs twn ....
I want records to be arranged in the above Order. OK?
Answer:
Bytes -------------------------------------------------------------------------------------
Order by decode (col, 'nch ', '1', 'hch', '2', 'acs', '3', 'twn', '4', col)
This is the case.
Note:
"Col" indicates the name of the column to be sorted.
'Nch', 'hch', 'acs', and so on indicate specific data in the sorted column.
"1", "2", "3", and so on indicate the specified sequence of the corresponding data.