1 頁 (共 1 頁)

[SQL Server][MySQL]order by find_in_set

發表於 : 2014年 8月 15日, 15:49
tim
在資料庫中使用 where in 查詢條件的排序結果為不定, 若是希望排序給定為自訂順序, MySql 可以用 order by find_in_set, 不過 MSSQL 沒有這樣的語法, 所以可以參考以下 workaround:

http://stackoverflow.com/questions/1024 ... der-in-sql

mysql order by find_in_set 參考
http://stackoverflow.com/questions/1631 ... l-in-query