<tfoot id='58rQk'></tfoot>
      <bdo id='58rQk'></bdo><ul id='58rQk'></ul>

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

      <small id='58rQk'></small><noframes id='58rQk'>

      mySQL 子查询限制

      mySQL subquery limit(mySQL 子查询限制)

      <small id='9o5H4'></small><noframes id='9o5H4'>

        <bdo id='9o5H4'></bdo><ul id='9o5H4'></ul>
          <tbody id='9o5H4'></tbody>
            • <legend id='9o5H4'><style id='9o5H4'><dir id='9o5H4'><q id='9o5H4'></q></dir></style></legend>
            • <tfoot id='9o5H4'></tfoot>

                <i id='9o5H4'><tr id='9o5H4'><dt id='9o5H4'><q id='9o5H4'><span id='9o5H4'><b id='9o5H4'><form id='9o5H4'><ins id='9o5H4'></ins><ul id='9o5H4'></ul><sub id='9o5H4'></sub></form><legend id='9o5H4'></legend><bdo id='9o5H4'><pre id='9o5H4'><center id='9o5H4'></center></pre></bdo></b><th id='9o5H4'></th></span></q></dt></tr></i><div id='9o5H4'><tfoot id='9o5H4'></tfoot><dl id='9o5H4'><fieldset id='9o5H4'></fieldset></dl></div>
                本文介绍了mySQL 子查询限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                这可能是一个简单的...我怎样才能通过这个查询实现我想要的:

                从没有 id 的帖子中删除(SELECT id FROM posts order by timestamp desc limit 0, 15)

                所以,简而言之,我想删除所有不在最新 15 条上的帖子.

                当我尝试那个查询时,我明白了

                <块引用>

                MySQL 尚不支持 'LIMIT &IN/ALL/ANY/SOME 子查询

                编辑

                mySQL Server 版本:5.5.8mySQL 客户端版本:mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $

                <块引用>

                错误:#1235 - 此版本的 MySQL 尚不支持 'LIMIT &IN/ALL/ANY/SOME 子查询'

                解决方案

                试试这个:

                删除发件人WHERE id 不在 (选择 * 从 (选择 ID发件人ORDER BY timestamp desc limit 0, 15)作为 t);

                This is probably an easy one... how can I achieve what i want with this query:

                delete from posts where id not in
                (SELECT id FROM posts order by timestamp desc limit 0, 15)
                

                so, to put it in a nutshell, I want to delete every post that isn't on the latest 15.

                When I try that query, I get that

                MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery

                EDIT

                mySQL Server version: 5.5.8
                mySQL Client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $
                

                Error: #1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

                解决方案

                Try this:

                DELETE 
                FROM posts 
                WHERE id not in (
                      SELECT * FROM (
                            SELECT id 
                            FROM posts 
                            ORDER BY timestamp desc limit 0, 15
                      ) 
                      as t);
                

                这篇关于mySQL 子查询限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Can#39;t Create Entity Data Model - using MySql and EF6(无法创建实体数据模型 - 使用 MySql 和 EF6)
                MySQL select with CONCAT condition(MySQL选择与CONCAT条件)
                Capitalize first letter of each word, in existing table(将现有表格中每个单词的首字母大写)
                How to retrieve SQL result column value using column name in Python?(如何在 Python 中使用列名检索 SQL 结果列值?)
                Update row with data from another row in the same table(使用同一表中另一行的数据更新行)
                Exporting results of a Mysql query to excel?(将 Mysql 查询的结果导出到 excel?)
              • <i id='nwOrV'><tr id='nwOrV'><dt id='nwOrV'><q id='nwOrV'><span id='nwOrV'><b id='nwOrV'><form id='nwOrV'><ins id='nwOrV'></ins><ul id='nwOrV'></ul><sub id='nwOrV'></sub></form><legend id='nwOrV'></legend><bdo id='nwOrV'><pre id='nwOrV'><center id='nwOrV'></center></pre></bdo></b><th id='nwOrV'></th></span></q></dt></tr></i><div id='nwOrV'><tfoot id='nwOrV'></tfoot><dl id='nwOrV'><fieldset id='nwOrV'></fieldset></dl></div>
              • <tfoot id='nwOrV'></tfoot>

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

                  <legend id='nwOrV'><style id='nwOrV'><dir id='nwOrV'><q id='nwOrV'></q></dir></style></legend>
                        <tbody id='nwOrV'></tbody>
                          <bdo id='nwOrV'></bdo><ul id='nwOrV'></ul>