<legend id='6s46V'><style id='6s46V'><dir id='6s46V'><q id='6s46V'></q></dir></style></legend>

      • <bdo id='6s46V'></bdo><ul id='6s46V'></ul>

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

      <small id='6s46V'></small><noframes id='6s46V'>

      如何在 MySQL 中模拟数组变量?

      时间:2023-08-19

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

          1. <small id='NNlz8'></small><noframes id='NNlz8'>

                <tbody id='NNlz8'></tbody>
              <i id='NNlz8'><tr id='NNlz8'><dt id='NNlz8'><q id='NNlz8'><span id='NNlz8'><b id='NNlz8'><form id='NNlz8'><ins id='NNlz8'></ins><ul id='NNlz8'></ul><sub id='NNlz8'></sub></form><legend id='NNlz8'></legend><bdo id='NNlz8'><pre id='NNlz8'><center id='NNlz8'></center></pre></bdo></b><th id='NNlz8'></th></span></q></dt></tr></i><div id='NNlz8'><tfoot id='NNlz8'></tfoot><dl id='NNlz8'><fieldset id='NNlz8'></fieldset></dl></div>
              <tfoot id='NNlz8'></tfoot>
                <bdo id='NNlz8'></bdo><ul id='NNlz8'></ul>
              • 本文介绍了如何在 MySQL 中模拟数组变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                似乎 MySQL 没有数组变量.我应该用什么代替?

                It appears that MySQL doesn't have array variables. What should I use instead?

                似乎建议了两种替代方案:集合类型标量临时表.我链接到的问题表明前者.但是使用这些而不是数组变量是一种好习惯吗?或者,如果我使用集合,那么与 foreach 等效的基于集合的习语是什么?

                There seem to be two alternatives suggested: A set-type scalar and temporary tables. The question I linked to suggests the former. But is it good practice to use these instead of array variables? Alternatively, if I go with sets, what would be the set-based idiom equivalent to foreach?

                推荐答案

                嗯,我一直在使用临时表而不是数组变量.不是最好的解决方案,但它有效.

                Well, I've been using temporary tables instead of array variables. Not the greatest solution, but it works.

                请注意,您不需要正式定义它们的字段,只需使用 SELECT 创建它们即可:

                Note that you don't need to formally define their fields, just create them using a SELECT:

                DROP TEMPORARY TABLE IF EXISTS my_temp_table;
                CREATE TEMPORARY TABLE my_temp_table
                    SELECT first_name FROM people WHERE last_name = 'Smith';
                

                (另请参见不使用创建表从选择语句创建临时表.)

                这篇关于如何在 MySQL 中模拟数组变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何将 Byte[] 插入 SQL Server VARBINARY 列 下一篇:将数组传递给 MySQL 存储例程

                相关文章

                最新文章

                • <bdo id='lPJG1'></bdo><ul id='lPJG1'></ul>

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

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

                  1. <tfoot id='lPJG1'></tfoot>

                  2. <legend id='lPJG1'><style id='lPJG1'><dir id='lPJG1'><q id='lPJG1'></q></dir></style></legend>