<bdo id='gPg5z'></bdo><ul id='gPg5z'></ul>
    1. <tfoot id='gPg5z'></tfoot>

    2. <small id='gPg5z'></small><noframes id='gPg5z'>

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

      1. 具有列名的多列的最大值?

        时间:2023-06-01
      2. <small id='coWt5'></small><noframes id='coWt5'>

      3. <tfoot id='coWt5'></tfoot>

            <tbody id='coWt5'></tbody>

        1. <i id='coWt5'><tr id='coWt5'><dt id='coWt5'><q id='coWt5'><span id='coWt5'><b id='coWt5'><form id='coWt5'><ins id='coWt5'></ins><ul id='coWt5'></ul><sub id='coWt5'></sub></form><legend id='coWt5'></legend><bdo id='coWt5'><pre id='coWt5'><center id='coWt5'></center></pre></bdo></b><th id='coWt5'></th></span></q></dt></tr></i><div id='coWt5'><tfoot id='coWt5'></tfoot><dl id='coWt5'><fieldset id='coWt5'></fieldset></dl></div>
          <legend id='coWt5'><style id='coWt5'><dir id='coWt5'><q id='coWt5'></q></dir></style></legend>
                <bdo id='coWt5'></bdo><ul id='coWt5'></ul>
                1. 本文介绍了具有列名的多列的最大值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  关于如何从多列中返回最大值以及列名,我已经探索了许多问题和答案.但我还没有解决问题这里在这个问题中将解释:

                  I have explored many questions and answers regarding how to return the greatest values from multiple columns along with column name. But I have not solved the problem here in this question will explain:

                  多列的SQL MAX?

                  但我不知道如何找出具有最大价值的列名?有什么想法吗?

                  But I don't know how to figure out the column name having greatest value? Any ideas?

                  推荐答案

                  您可以使用 GREATEST 函数在所有列中找到最大值:

                  You can use GREATEST function to find the maximum value among all columns:

                  SELECT @var_max_val:= GREATEST(col1, col2, col3, ...) AS max_value,
                         CASE @var_max_val WHEN col1 THEN 'col1'
                                           WHEN col2 THEN 'col2'
                                           ...
                         END AS max_value_column_name
                  FROM table_name
                  WHERE ...
                  

                  这篇关于具有列名的多列的最大值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 MySQL 4(不是 5)中总结逗号分隔的列 下一篇:sql 连接表,其中 1 列有逗号

                  相关文章

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

                    <tfoot id='bToh9'></tfoot>