久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='QlE7f'></bdo><ul id='QlE7f'></ul>
      <tfoot id='QlE7f'></tfoot>

      <small id='QlE7f'></small><noframes id='QlE7f'>

      1. <legend id='QlE7f'><style id='QlE7f'><dir id='QlE7f'><q id='QlE7f'></q></dir></style></legend>
        <i id='QlE7f'><tr id='QlE7f'><dt id='QlE7f'><q id='QlE7f'><span id='QlE7f'><b id='QlE7f'><form id='QlE7f'><ins id='QlE7f'></ins><ul id='QlE7f'></ul><sub id='QlE7f'></sub></form><legend id='QlE7f'></legend><bdo id='QlE7f'><pre id='QlE7f'><center id='QlE7f'></center></pre></bdo></b><th id='QlE7f'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QlE7f'><tfoot id='QlE7f'></tfoot><dl id='QlE7f'><fieldset id='QlE7f'></fieldset></dl></div>

      2. 按以數字開頭的字符串排序 - ActiveRecord

        Ordering by String that starts with Number - ActiveRecord(按以數字開頭的字符串排序 - ActiveRecord)
          <tbody id='GtT59'></tbody>
        <legend id='GtT59'><style id='GtT59'><dir id='GtT59'><q id='GtT59'></q></dir></style></legend>

        <i id='GtT59'><tr id='GtT59'><dt id='GtT59'><q id='GtT59'><span id='GtT59'><b id='GtT59'><form id='GtT59'><ins id='GtT59'></ins><ul id='GtT59'></ul><sub id='GtT59'></sub></form><legend id='GtT59'></legend><bdo id='GtT59'><pre id='GtT59'><center id='GtT59'></center></pre></bdo></b><th id='GtT59'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GtT59'><tfoot id='GtT59'></tfoot><dl id='GtT59'><fieldset id='GtT59'></fieldset></dl></div>

          <bdo id='GtT59'></bdo><ul id='GtT59'></ul>

            <tfoot id='GtT59'></tfoot>
          1. <small id='GtT59'></small><noframes id='GtT59'>

                  本文介紹了按以數字開頭的字符串排序 - ActiveRecord的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在構建 Rails 應用程序并嘗試按以數字開頭的字符串列對數據庫中的記錄進行排序.
                  怎么先按號碼下單?
                  我寧愿按 SQL 順序排序,也不愿按 ruby?? 方法排序.有什么辦法嗎?

                  I'm building Rails app and trying to order records in database by string column that starts with number.
                  How can I order by the number at first?
                  I'd rather ordering as SQL order than sorting by ruby method. Is there any way?

                  expected order
                  1.record1
                  2.record2
                  10.record10
                  

                  present order
                  1.record1
                  10.record10
                  2.record2
                  

                  推薦答案

                  您可以order by field + 0 改變field的數據類型code> 隱式轉換為一個數字:

                  You could order by field + 0 to change the data type of field to a number implicitly:

                  Model.order("field + 0 ASC")
                  
                  # similar `string`.to_i in Ruby
                  # `1.record1`   => 1
                  # `10.record10` => 10
                  

                  這篇關于按以數字開頭的字符串排序 - ActiveRecord的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統)中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務計劃程序中的 PowerShell MySQL 備份腳本錯誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數據從 XML 文件導入 MySQL 數據庫)
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動時的錯誤)
                  Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫表)
                1. <i id='QlNS1'><tr id='QlNS1'><dt id='QlNS1'><q id='QlNS1'><span id='QlNS1'><b id='QlNS1'><form id='QlNS1'><ins id='QlNS1'></ins><ul id='QlNS1'></ul><sub id='QlNS1'></sub></form><legend id='QlNS1'></legend><bdo id='QlNS1'><pre id='QlNS1'><center id='QlNS1'></center></pre></bdo></b><th id='QlNS1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QlNS1'><tfoot id='QlNS1'></tfoot><dl id='QlNS1'><fieldset id='QlNS1'></fieldset></dl></div>

                    • <bdo id='QlNS1'></bdo><ul id='QlNS1'></ul>

                      • <legend id='QlNS1'><style id='QlNS1'><dir id='QlNS1'><q id='QlNS1'></q></dir></style></legend>
                          <tbody id='QlNS1'></tbody>
                            <tfoot id='QlNS1'></tfoot>

                            <small id='QlNS1'></small><noframes id='QlNS1'>

                            主站蜘蛛池模板: h视频免费在线观看 | 亚洲国产日韩一区 | 精品国产乱码久久久久久果冻传媒 | 久久久999成人 | 国产一二区视频 | 91视频在线网站 | 一级毛片免费看 | 一级片免费视频 | 精品一区久久 | 日韩精品久久久久 | 91福利在线观看视频 | 成年人在线视频 | 国产精品中文字幕一区二区三区 | 久久久国产精品 | 国产成在线观看免费视频 | 久久夜视频 | 色播99 | www.夜夜骑.com | 高清国产一区二区 | 精品国产乱码 | 日本一区二区高清视频 | 精品自拍视频在线观看 | 亚欧洲精品在线视频免费观看 | 国产一区二区三区四区五区3d | 七七婷婷婷婷精品国产 | 欧美aaaaa| 欧美一级欧美三级在线观看 | 国产农村妇女毛片精品久久麻豆 | 91精品国产色综合久久不卡98 | 婷婷色成人 | 欧美日韩高清 | 亚洲国产精品日本 | 97视频成人 | 成人久久18免费网站麻豆 | av一区二区在线观看 | 国产免费麻豆视频 | 亚洲精品中文字幕中文字幕 | 亚洲伊人久久综合 | 欧美精品tv | 久久久精品一区二区 | 成人高清网站 |