久久久久久久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. 按以數(shù)字開頭的字符串排序 - ActiveRecord

        Ordering by String that starts with Number - ActiveRecord(按以數(shù)字開頭的字符串排序 - 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'>

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

                  問題描述

                  限時送ChatGPT賬號..

                  我正在構(gòu)建 Rails 應(yīng)用程序并嘗試按以數(shù)字開頭的字符串列對數(shù)據(jù)庫中的記錄進(jìn)行排序.
                  怎么先按號碼下單?
                  我寧愿按 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的數(shù)據(jù)類型code> 隱式轉(zhuǎn)換為一個數(shù)字:

                  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
                  

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

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

                  相關(guān)文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產(chǎn)品、類別和元數(shù)據(jù)的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統(tǒng))中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務(wù)計劃程序中的 PowerShell MySQL 備份腳本錯誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數(shù)據(jù)從 XML 文件導(dǎo)入 MySQL 數(shù)據(jù)庫)
                  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'>

                            主站蜘蛛池模板: 亚洲一区二区中文字幕在线观看 | 欧美日韩亚洲国产综合 | 日韩免费高清视频 | 亚洲精品久久久蜜桃网站 | 成人在线看片 | 国产一区视频在线 | 日韩a级片| 激情 一区 | 国产大学生情侣呻吟视频 | 亚洲欧美aⅴ | 另类一区 | 日韩一区二区av | 九九视频在线观看 | 日韩精品一区二 | 精品一区二区三区四区五区 | 国产伦精品一区二区三区高清 | 久久久亚洲综合 | 99久久免费精品 | 亚洲精品自拍 | 日韩精品一二三区 | 欧美综合一区二区 | 午夜激情网 | 国产男女视频网站 | 国产一级片 | 成人一级黄色毛片 | 国产精品亚洲第一 | 日韩美香港a一级毛片免费 国产综合av | 国产精品久久久久久久 | 亚洲欧洲精品一区 | 亚洲成人www | 有码在线 | 少妇精品亚洲一区二区成人 | 国产高清无av久久 | 一级全黄少妇性色生活免费看 | 免费视频久久久久 | www久久久 | 欧美视频第三页 | 久久精点视频 | 欧美日韩91 | 国产精品久久久亚洲 | 91在线视频免费观看 |