久久久久久久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'>

                            主站蜘蛛池模板: 日韩欧美中文字幕在线观看 | 天天操夜夜爽 | 91成人免费观看 | 99热免费在线 | 亚洲精品在线看 | 色妞av| 日韩一区二区三区精品 | 成人免费观看男女羞羞视频 | 在线婷婷 | 91在线网站| caoporon| 精品国产乱码久久久久久丨区2区 | 免费看a | 久久婷婷国产麻豆91 | av中文字幕在线观看 | 在线观看中文字幕视频 | 在线观看免费观看在线91 | 国户精品久久久久久久久久久不卡 | 天堂久久天堂综合色 | eeuss国产一区二区三区四区 | 成人国产精品久久久 | 精品成人一区 | 国产精彩视频 | 一区二区三区久久久 | 亚洲精品视频导航 | 97色在线视频 | 中文字幕视频三区 | 久久精品成人 | 一级毛片视频 | 羞羞视频免费观看入口 | 亚洲一区二区三区在线播放 | 黄色网址在线免费观看 | 91亚洲精品国偷拍自产在线观看 | 一区二区三区中文字幕 | 香蕉视频91| 欧美乱大交xxxxx另类电影 | 亚洲精品在线视频 | 国产成人精品一区二区三区四区 | 福利视频一区 | 欧美在线看片 | 99视频在线 |