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

        <bdo id='x2rjD'></bdo><ul id='x2rjD'></ul>
      <tfoot id='x2rjD'></tfoot>

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

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

        将字段值连接到 SQL Server 中的字符串

        Concat field value to string in SQL Server(将字段值连接到 SQL Server 中的字符串)
        • <tfoot id='u4Bh1'></tfoot>

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

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

              <legend id='u4Bh1'><style id='u4Bh1'><dir id='u4Bh1'><q id='u4Bh1'></q></dir></style></legend>
                • <bdo id='u4Bh1'></bdo><ul id='u4Bh1'></ul>
                  本文介绍了将字段值连接到 SQL Server 中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要一个与 SQL Server 中的 Oracle WM_CONCAT 类似的函数,它返回一个逗号分隔的列表,其中包含您将其作为参数传递的任何字段.例如,在 Oracle 中,

                  I need a similar function to Oracle WM_CONCAT in SQL Server, which returns a comma separated list of whatever field you pass it as argument. For example, in Oracle,

                  select WM_CONCAT(first_name) from employee where state='CA' 
                  

                  返回约翰、吉姆、鲍勃".

                  returns "John, Jim, Bob".

                  如何在 SQL Server 中执行此操作?

                  How can I do this in SQL Server?

                  谢谢

                  推荐答案

                  在SQL Server 2017中增加了STRING_AGG函数

                  In SQL Server 2017 STRING_AGG function has been added

                  SELECT t.name as TableName
                        ,STRING_AGG(c.name, ';') AS FieldList
                    FROM sys.tables t
                    JOIN sys.columns c 
                      ON t.object_id = c.object_id
                    GROUP BY t.name;
                  

                  这篇关于将字段值连接到 SQL Server 中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

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

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

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

                          <tbody id='ITIAJ'></tbody>