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

<legend id='x0pgc'><style id='x0pgc'><dir id='x0pgc'><q id='x0pgc'></q></dir></style></legend>

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

        <bdo id='x0pgc'></bdo><ul id='x0pgc'></ul>
    1. <tfoot id='x0pgc'></tfoot>

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

        mySQL 查詢鍵值對

        mySQL query key value pairs(mySQL 查詢鍵值對)
          <bdo id='WXRFA'></bdo><ul id='WXRFA'></ul>

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

              <tbody id='WXRFA'></tbody>
          3. <tfoot id='WXRFA'></tfoot>

                  本文介紹了mySQL 查詢鍵值對的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在對 wordpress 表 (postmeta) 進行查詢.該表有鍵和值,我需要一個查詢來獲取所有匹配key1"等于value1"和key2"等于value2"的行,按value2排序

                  I am doing a query on a wordpress table (postmeta). The table has keys and values and I need a query that will get all rows that match "key1" equal to "value1" and "key2" equal to "value2" ordered by value2

                  該表基本上有 id、postid、key 和 value 列.

                  The table basically has an id, postid, key and value columns.

                  我什至不知道從哪里開始.我可以找到一個很好的值,即 ... where key='featured' &值=真.但我需要按行的值排序的前 25 個,其中 key='hits' 意味著我需要這些特色行的相應命中鍵的值

                  I am not sure even where to start. I can find one value fine ie ... where key='featured' & value=true. But I need the top 25 ordered by the value of the rows where key='hits' meaning I need the value of the corresponding hits key for those featured rows

                  我不知道該怎么做.

                  TIA

                  推薦答案

                  根據您提供的有限詳細信息,很難確切說明如何執行此操作.但是當您想返回鍵/值對時,您可以使用以下方法.

                  It is difficult to say exactly how to do this with the limited details that you provided. But when you want to return key/value pairs you can use the following.

                  您可以多次加入您的桌子:

                  You can join on your table multiple times:

                  select p1.postid,
                    p1.value Featured,
                    p2.value Hits
                  from postmeta p1
                  left join postmeta p2
                    on p1.postid = p2.postid
                    and p2.key = 'hits'
                  where p1.key ='featured';
                  

                  參見SQL Fiddle with Demo

                  或者你可以使用帶有 CASE 表達式的聚合函數(使用 sum() 假設一個數值,你可以使用 max()/min() 用于字符串值:

                  Or you can use an aggregate function with a CASE expression (using sum() assumes a numeric value, you can use max()/min() for string values:

                  select postid,
                    sum(case when `key` = 'featured' then value end) Featured,
                    sum(case when `key` = 'hits' then value end) Hits
                  from postmeta
                  group by postid
                  

                  參見SQL Fiddle with Demo

                  這篇關于mySQL 查詢鍵值對的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統)中使用 MySQL?)

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

                          <tbody id='BuwGL'></tbody>
                          <bdo id='BuwGL'></bdo><ul id='BuwGL'></ul>

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

                          • 主站蜘蛛池模板: 九九热在线免费视频 | 中文字幕在线视频观看 | 日本一区二区不卡 | 欧美在线视频一区二区 | 久久久精品影院 | 激情网站 | 一区二区三区免费网站 | 国产精品永久免费 | 欧美日韩亚洲国产 | 午夜看片网站 | 日批免费观看 | 亚洲精品一区二区三区在线观看 | 欧美黑人激情 | 欧美一级久久久猛烈a大片 日韩av免费在线观看 | 综合一区| 日韩av一区二区在线 | 有码在线| 国产精品嫩草影院精东 | 黄色片在线观看网址 | 国产成人久久精品一区二区三区 | 高清av一区 | 亚洲一区二区三区免费视频 | 亚洲国产视频一区二区 | 成人高清在线视频 | 一级黄色毛片 | 色综合一区二区 | 九色视频网站 | 中文字幕在线免费观看 | 成人免费福利视频 | 亚洲欧美日韩久久 | 玖玖玖在线观看 | 亚洲欧洲色视频 | 久久久国产精品入口麻豆 | 欧洲高清转码区一二区 | 日韩精品一区二区三区在线观看 | 中文字幕亚洲欧美 | 毛片大全| 免费一级片 | 91视频网址 | 午夜久久久久久久久久一区二区 | 午夜精 |