• <small id='UQA41'></small><noframes id='UQA41'>

    <legend id='UQA41'><style id='UQA41'><dir id='UQA41'><q id='UQA41'></q></dir></style></legend><tfoot id='UQA41'></tfoot>

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

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

      1. MySQL - 选择最后插入的行的最简单方法

        时间:2023-10-08

          <tbody id='XmhMw'></tbody>

          <tfoot id='XmhMw'></tfoot>
        • <small id='XmhMw'></small><noframes id='XmhMw'>

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

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

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

                1. 本文介绍了MySQL - 选择最后插入的行的最简单方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我只需要选择由条件指定的最后输入的行,例如:

                  I simply need to select the last entered row specified by condition, e.g:

                  SELECT ID from bugs WHERE user=Me
                  

                  我只需要返回用户我"输入的最后一个 ID.有没有一种简单的方法可以做到这一点?谢谢.

                  I need to return only the very last ID entered by user 'Me'. Is there a simple way to do this? Thank you.

                  推荐答案

                  最好有一个 TIMESTAMP 列,默认为 CURRENT_TIMESTAMP ..它是唯一的您可以在此处找到真正的预测行为.

                  It would be best to have a TIMESTAMP column that defaults to CURRENT_TIMESTAMP .. it is the only true predictive behavior you can find here.

                  你能做的第二好的事情是ORDER BY ID DESC LIMIT 1并希望最新的ID是最大值.

                  The second-best thing you can do is ORDER BY ID DESC LIMIT 1 and hope the newest ID is the largest value.

                  这篇关于MySQL - 选择最后插入的行的最简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 SELECT FROM 语句中使用表类型? 下一篇:MySql select IN 子句字符串逗号分隔

                  相关文章

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

                2. <tfoot id='WUTaB'></tfoot>

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