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

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

      <legend id='DMio6'><style id='DMio6'><dir id='DMio6'><q id='DMio6'></q></dir></style></legend>
      • <bdo id='DMio6'></bdo><ul id='DMio6'></ul>

      1. 如何在 MySQL 中为字段或列设置别名?

        时间:2023-06-26

          <legend id='mDBdJ'><style id='mDBdJ'><dir id='mDBdJ'><q id='mDBdJ'></q></dir></style></legend>
            • <small id='mDBdJ'></small><noframes id='mDBdJ'>

            • <tfoot id='mDBdJ'></tfoot>
              • <bdo id='mDBdJ'></bdo><ul id='mDBdJ'></ul>

                  <tbody id='mDBdJ'></tbody>

                  <i id='mDBdJ'><tr id='mDBdJ'><dt id='mDBdJ'><q id='mDBdJ'><span id='mDBdJ'><b id='mDBdJ'><form id='mDBdJ'><ins id='mDBdJ'></ins><ul id='mDBdJ'></ul><sub id='mDBdJ'></sub></form><legend id='mDBdJ'></legend><bdo id='mDBdJ'><pre id='mDBdJ'><center id='mDBdJ'></center></pre></bdo></b><th id='mDBdJ'></th></span></q></dt></tr></i><div id='mDBdJ'><tfoot id='mDBdJ'></tfoot><dl id='mDBdJ'><fieldset id='mDBdJ'></fieldset></dl></div>
                  本文介绍了如何在 MySQL 中为字段或列设置别名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试做这样的事情.但我收到一个未知的列错误:

                  I'm trying to do something like this. But I get an unknown column error:

                  SELECT SUM(field1 + field2) AS col1, col1 + field3 AS col3 from core
                  

                  基本上,我只想使用别名,这样我就不需要执行之前执行的操作.这在mysql中可能吗?

                  Basically, I want to just use the alias so that I won't need to perform the operations performed earlier. Is this possible in mysql?

                  推荐答案

                  考虑使用子查询,例如:

                  Consider using a subquery, like:

                  SELECT col1
                  ,      col1 + field3 AS col3 
                  FROM   (
                         SELECT  field1 + field2 as col1
                         ,       field3
                         from    core
                         ) as SubQueryAlias
                  

                  这篇关于如何在 MySQL 中为字段或列设置别名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:MySQL 并发,它是如何工作的,我是否需要在我的应用程序中处理它 下一篇:使用联合或加入 - 哪个更快

                  相关文章

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

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

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

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