<tfoot id='DDNwq'></tfoot>
      <legend id='DDNwq'><style id='DDNwq'><dir id='DDNwq'><q id='DDNwq'></q></dir></style></legend>

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

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

        • <bdo id='DDNwq'></bdo><ul id='DDNwq'></ul>
      1. mysql 选择不同的行到逗号分隔的列表列中

        时间:2023-06-25

              <legend id='7iqkQ'><style id='7iqkQ'><dir id='7iqkQ'><q id='7iqkQ'></q></dir></style></legend>

              <small id='7iqkQ'></small><noframes id='7iqkQ'>

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

                  本文介绍了mysql 选择不同的行到逗号分隔的列表列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前有一些带回标签的 sql.他们应该有不同的 id,但他们没有......所以我当前的数据是这样的:

                  I currently have some sql that brings back tags. they should have distinct ids, but they don't.... so my current data is like:

                  Microsoft | GGG | 1 | 167
                  Microsoft | GGG | 1 | 2
                  Microsoft | GGG | 1 | 1
                  

                  我想要做的是只返回一行,最后一列连接成一个分隔列表,如:

                  What i would like to do is have only one row come back with the final column concatenated into a delimited list like:

                  Microsoft | GGG | 1 | 167, 2, 1
                  

                  我为此使用了 mySQL 5.

                  I am using mySQL 5 for this.

                  推荐答案

                  使用 GROUP_CONCAT() 为此,GROUP BY 覆盖其他三列:

                  Use GROUP_CONCAT() for this, with a GROUP BY covering the other three columns:

                  SELECT 
                    name,   -- Microsoft
                    other,  -- GGG
                    other2, -- 1
                    GROUP_CONCAT(id) AS ids
                  FROM tbl
                  GROUP BY name, other, other2
                  

                  这篇关于mysql 选择不同的行到逗号分隔的列表列中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:什么时候推荐使用 MySQL BLOB? 下一篇:使用 MySQL 判断今天是否是用户的生日

                  相关文章

                    <legend id='MlsTN'><style id='MlsTN'><dir id='MlsTN'><q id='MlsTN'></q></dir></style></legend>
                      <tfoot id='MlsTN'></tfoot>
                        <bdo id='MlsTN'></bdo><ul id='MlsTN'></ul>

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

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