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

    <legend id='9v910'><style id='9v910'><dir id='9v910'><q id='9v910'></q></dir></style></legend>
          <bdo id='9v910'></bdo><ul id='9v910'></ul>
      1. <small id='9v910'></small><noframes id='9v910'>

      2. MySQL是否“选择限制1"?有多条记录从顶部选择第一条记录?

        Does MySQL quot;SELECT LIMIT 1quot; with multiple records select first record from the top?(MySQL是否“选择限制1?有多条记录从顶部选择第一条记录?)

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

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

                <tfoot id='VYwVS'></tfoot>
                • <legend id='VYwVS'><style id='VYwVS'><dir id='VYwVS'><q id='VYwVS'></q></dir></style></legend>
                • 本文介绍了MySQL是否“选择限制1"?有多条记录从顶部选择第一条记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我搜索了又搜索,但找不到这个问题的答案,我可能问错了.

                  I've searched and searched and can't find an answer to this question, I'm probably asking it in the wrong way.

                  我正在查询员工数据库.

                  I am querying an employee database.

                  我需要根据职位 id 获取详细信息,但是该职位 id 可能有多个记录,因为该组织有长期雇员和临时雇员反对同一职位.

                  I need to get details based on a position id, however there could be multiple records for that position id as this organisation has permanent employees and temporary employees that act against the same position.

                  因此,为了获得位置 id 的 CURRENT 占用者,我需要我的查询从顶部向下选择与位置字符串匹配的第一个记录.

                  So, in order to get the CURRENT occupant of the position id, I need my query to SELECT the FIRST record that matches the position string, from the TOP DOWN.

                  这会从顶部选择第一个匹配的记录吗?

                  will this select the first matched record from the top?

                  SELECT * WHERE `position_id`="00000000" LIMIT 1;
                  

                  提前致谢.

                  推荐答案

                  您需要一个 ORDER BY 子句来定义表中各个记录之间的顺序.如果不使用 ORDER BY,则可以假设记录之间没有固定顺序,并且每次执行查询时都可以获得新顺序.

                  You need an ORDER BY clause to define the ordering between the individual records your table. If you do not use ORDER BY you can assume no fixed order between the records, and you could get a new order each time you executed the query.

                  这篇关于MySQL是否“选择限制1"?有多条记录从顶部选择第一条记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Set the variable result, from query(设置变量结果,来自查询)
                  What is dynamic SQL?(什么是动态 SQL?)
                  Mysql - How to quit/exit from stored procedure(Mysql - 如何退出/退出存储过程)
                  Does MySQL have time-based triggers?(MySQL 有基于时间的触发器吗?)
                  is it possible to call a sql script from a stored procedure in another sql script?(是否可以从另一个 sql 脚本中的存储过程调用 sql 脚本?)
                  Procedure to loop through comma separated string is not working(遍历逗号分隔字符串的过程不起作用)
                    <bdo id='LlQd0'></bdo><ul id='LlQd0'></ul>
                    <tfoot id='LlQd0'></tfoot>
                    <i id='LlQd0'><tr id='LlQd0'><dt id='LlQd0'><q id='LlQd0'><span id='LlQd0'><b id='LlQd0'><form id='LlQd0'><ins id='LlQd0'></ins><ul id='LlQd0'></ul><sub id='LlQd0'></sub></form><legend id='LlQd0'></legend><bdo id='LlQd0'><pre id='LlQd0'><center id='LlQd0'></center></pre></bdo></b><th id='LlQd0'></th></span></q></dt></tr></i><div id='LlQd0'><tfoot id='LlQd0'></tfoot><dl id='LlQd0'><fieldset id='LlQd0'></fieldset></dl></div>

                    1. <legend id='LlQd0'><style id='LlQd0'><dir id='LlQd0'><q id='LlQd0'></q></dir></style></legend>

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

                          <tbody id='LlQd0'></tbody>