• <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 - 选择最后插入的行的最简单方法

        MySQL - Select the last inserted row easiest way(MySQL - 选择最后插入的行的最简单方法)

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

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

                  相关文档推荐

                  Building a comma separated list?(建立一个逗号分隔的列表?)
                  Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
                  How to update a record using sequelize for node?(如何使用节点的 sequelize 更新记录?)
                  How to provide a mysql database connection in single file in nodejs(如何在 nodejs 中的单个文件中提供 mysql 数据库连接)
                  Defining a one-to-one relationship in SQL Server(在 SQL Server 中定义一对一关系)
                  Looping Over Result Sets in MySQL(在 MySQL 中循环结果集)

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

                    • <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>
                            <tbody id='WUTaB'></tbody>
                          • <bdo id='WUTaB'></bdo><ul id='WUTaB'></ul>