愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity vroid

mysql指定排序

post date - 2024/01/06
last update - 2024/01/06

在首頁顯示東西時意外用到這個東西,可以照指定的值來進行排序的方法,單純做個紀錄。

方法

mysql可以使用使用FIELD來指定順序,欄位名稱後面用,指定值得順序就好,只要有相同的值就會照這個順序排下來

ORDER BY FIELD (欄位名稱, 4, 5, 6, 1, 2, 3, 10, -4, 13, 11, 7, 12)

參考資料

https://stackoverflow.com/questions/7802944/explicitly-specify-sort-order-for-mysql-query

Tags : mysql

series

3d軟體 (1) apache (1) css (4) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity vroid

Recent Posts

地城謎蹤

2023/10/09

mysql group by max取得同一行其他資料

2023/09/03

javascript 統一編號檢查

2023/12/17

javascript 時間文字轉yyyymmdd

2024/09/07

php檔案上傳

2022/12/03

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2026 愚者樹屋